Skip to content

Commit

Permalink
fix: Don't test bounceChild(Base) in release because that is optimi…
Browse files Browse the repository at this point in the history
…zed away (#353)
  • Loading branch information
mrousavy authored Nov 19, 2024
1 parent 8c09f6d commit 3626cb3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions example/src/getTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,15 @@ export function getTests(
),
createTest('bounceChild(Base) throws', () =>
it(() => {
const child = testObject.createBase()
// @ts-expect-error
testObject.bounceChild(child)
if (__DEV__) {
const child = testObject.createBase()
// @ts-expect-error
testObject.bounceChild(child)
} else {
throw new Error(
`This only throws in __DEV__ - in release it is optimized away and would crash. :)`
)
}
}).didThrow()
),
createTest('bounceChildBase(Child) ===', () =>
Expand Down

0 comments on commit 3626cb3

Please sign in to comment.