Create a gist now

Instantly share code, notes, and snippets.

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