diff --git a/test/electron/renderer.html b/test/electron/renderer.html index 38005b2d609..49cfa95c657 100644 --- a/test/electron/renderer.html +++ b/test/electron/renderer.html @@ -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