This commit is contained in:
Joao Moreno 2019-11-13 10:39:47 +01:00
parent d8f35641fb
commit 48af7ba677
No known key found for this signature in database
GPG key ID: 9494F5E6167A8E6B

View file

@ -23,6 +23,16 @@
window.alert = function () { throw new Error('window.alert() is not supported in tests!'); }
window.confirm = function () { throw new Error('window.confirm() is not supported in tests!'); }
// Ignore uncaught cancelled promise errors
window.addEventListener('unhandledrejection', e => {
const name = e && e.reason && e.reason.name;
if (name === 'Canceled') {
e.preventDefault();
e.stopPropagation();
}
});
mocha.setup({
ui: 'tdd',
timeout: 5000