Skip to content

Instantly share code, notes, and snippets.

@TheSavior
Created November 3, 2016 05:38
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/35e6ebea11f20d9196dcb86c86ed3ea5 to your computer and use it in GitHub Desktop.
Save TheSavior/35e6ebea11f20d9196dcb86c86ed3ea5 to your computer and use it in GitHub Desktop.
Use karma error func
it('should reject', function() {
Promise.reject(new Error('unhandled rejection'));
});
it('should delay', (done) => {
setTimeout(done, 100);
});
window.addEventListener('unhandledrejection', function(err) {
window.__karma__.error(err.reason.stack);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment