Skip to content

Commit

Permalink
Fix 'Unhandled promise rejection (rejection id: 1): ReferenceError: s…
Browse files Browse the repository at this point in the history
…etTimeout is not defined' warning.
  • Loading branch information
loganfsmyth committed May 5, 2017
1 parent 14584c2 commit 6646707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Expand Up @@ -20,6 +20,8 @@ const testContext = vm.createContext({
...helpers,
assert: chai.assert,
transform: babel.transform,
setTimeout: setTimeout,
setImmediate: setImmediate,
});
testContext.global = testContext;

Expand Down
Expand Up @@ -8,12 +8,6 @@ async function foo({ a, b = mandatory("b") } = {}) {
return Promise.resolve(b);
}

return (async () => {
assert.doesNotThrow(() => {
foo()
.then(() => {
throw new Error('should not occcur');
})
.catch(() => true);
});
})();
return foo().then(() => {
throw new Error('should not occcur');
}, () => true);

0 comments on commit 6646707

Please sign in to comment.