Skip to content

Instantly share code, notes, and snippets.

@TheSavior
Created November 3, 2016 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSavior/7b3f01acaa9f00b6fe575bce9fc83760 to your computer and use it in GitHub Desktop.
Save TheSavior/7b3f01acaa9f00b6fe575bce9fc83760 to your computer and use it in GitHub Desktop.
browser unhandled listener
it('should reject', function() {
Promise.reject(new Error('unhandled rejection'));
});
it('should delay', (done) => {
setTimeout(done, 100);
});
window.addEventListener('unhandledrejection', function(err) {
throw err.reason.stack;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment