Skip to content

Commit

Permalink
pr
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnMorreau committed May 1, 2024
1 parent 36acdbe commit 33eb0d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 29 deletions.
10 changes: 0 additions & 10 deletions ark/attest/__tests__/assert.snapshots.json

This file was deleted.

7 changes: 0 additions & 7 deletions ark/attest/__tests__/custom.snapshots.json

This file was deleted.

24 changes: 12 additions & 12 deletions ark/attest/__tests__/demo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ contextualize(() => {
// works for keys or index access as well (may need prettier-ignore to
// avoid removing quotes)
// prettier-ignore
attest({ f: "🐐" } as Legends).completions({ f: ["faker"] })
})

it("integrate runtime logic with type assertions", () => {
const arrayOf = type("<t>", "t[]")
const numericArray = arrayOf("number | bigint")
// flexibly combine runtime logic with type assertions to customize your
// tests beyond what is possible from pure static-analysis based type testing tools
if (getPrimaryTsVersionUnderTest().startsWith("5")) {
// this assertion will only occur when testing TypeScript 5+!
attest<(number | bigint)[]>(numericArray.infer)
}
attest({ "f": "🐐" } as Legends).completions({ f: ["faker"] })
})
// TODO: reenable once generics are finished
// it("integrate runtime logic with type assertions", () => {
// const arrayOf = type("<t>", "t[]")
// const numericArray = arrayOf("number | bigint")
// // flexibly combine runtime logic with type assertions to customize your
// // tests beyond what is possible from pure static-analysis based type testing tools
// if (getPrimaryTsVersionUnderTest().startsWith("5")) {
// // this assertion will only occur when testing TypeScript 5+!
// attest<(number | bigint)[]>(numericArray.infer)
// }
// })
})

0 comments on commit 33eb0d6

Please sign in to comment.