Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else {
// something else is up
throw e
}
}
}, deps)
}
hijackEffects({callCount: 2})
let rendered = false
// it's super weird, but somehow the error is not try/catchable here, but
// it still fails the test. It's really odd. So we do some weird stuff to make
// sure we wait for it to be thrown.
await wait(
() => {
if (!rendered) {
rendered = true
render(ui)
}
expect(console.warn).toHaveBeenCalledTimes(1)
},
{timeout: 500},
)
}
it('should fail on invalid inputs', () => {
// $ExpectError
wait(1);
// $ExpectError
wait(() => {}, 1);
});
it('should fail on invalid inputs', () => {
// $ExpectError
wait(1);
// $ExpectError
wait(() => {}, 1);
});
it('should fail on invalid inputs', () => {
// $ExpectError
wait(1);
// $ExpectError
wait(() => {}, 1);
});
it('should fail on invalid inputs', () => {
// $ExpectError
wait(1);
// $ExpectError
wait(() => {}, 1);
});