Fix 'Unhandled promise rejection (rejection id: 1): ReferenceError: setTimeout is not defined' warning.
This commit is contained in:
@@ -20,6 +20,8 @@ const testContext = vm.createContext({
|
||||
...helpers,
|
||||
assert: chai.assert,
|
||||
transform: babel.transform,
|
||||
setTimeout: setTimeout,
|
||||
setImmediate: setImmediate,
|
||||
});
|
||||
testContext.global = testContext;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user