Skip to content

Instantly share code, notes, and snippets.

View pokle's full-sized avatar

Tushar Pokle pokle

View GitHub Profile
@pokle
pokle / jest-guard.js
Last active June 15, 2018 04:26
Guard against common Jest assertion testing shortcomings
// Unfortunately there's no global unhandledResolve handler :-(
process.on('unhandledRejection', error => {
console.error('unhandledRejection', error);
throw new Error('unhandledRejection' + error);
});
beforeEach(() => expect.hasAssertions());