Skip to content

Commit

Permalink
fix assert test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Mar 7, 2023
1 parent 69c2a58 commit a4a0bca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testing.test.js
Expand Up @@ -12,7 +12,7 @@ export const nottestingNotTested = () => {

export const testAssertTyping = () => {
const q = Math.random()
const x = q === 0.3 ? { a: 4 } : null
const x = q === 0.3 ? null : { a: 4 } // this should always be an object
// t.assert(x.a === 4) - this will give a type error because the type is uncertain
t.assert(x)
t.assert(x.a === 4) // this works because x is asserted
Expand Down

0 comments on commit a4a0bca

Please sign in to comment.