mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: use .then(common.mustCall()) for all async IIFEs
This makes sure that all async functions finish as expected. PR-URL: https://github.com/nodejs/node/pull/34363 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
55fc206d13
commit
89ee6abae0
34 files changed
+54
-60
No files matched your search
@@ -32,7 +32,7 @@ const util = require('util');
|
||||
baz: 'bar',
|
||||
typeofProcess: 'undefined'
|
||||
});
|
||||
}());
|
||||
}().then(common.mustCall()));
|
||||
|
||||
(async () => {
|
||||
const m = new SourceTextModule(`
|
||||
@@ -45,14 +45,14 @@ const util = require('util');
|
||||
assert.strictEqual(global.vmResultTypeofProcess, '[object process]');
|
||||
delete global.vmResultFoo;
|
||||
delete global.vmResultTypeofProcess;
|
||||
})();
|
||||
})().then(common.mustCall());
|
||||
|
||||
(async () => {
|
||||
const m = new SourceTextModule('while (true) {}');
|
||||
await m.link(common.mustNotCall());
|
||||
await m.evaluate({ timeout: 500 })
|
||||
.then(() => assert(false), () => {});
|
||||
})();
|
||||
})().then(common.mustCall());
|
||||
|
||||
// Check the generated identifier for each module
|
||||
(async () => {
|
||||
@@ -65,7 +65,7 @@ const util = require('util');
|
||||
assert.strictEqual(m2.identifier, 'vm:module(1)');
|
||||
const m3 = new SourceTextModule('3', { context: context2 });
|
||||
assert.strictEqual(m3.identifier, 'vm:module(0)');
|
||||
})();
|
||||
})().then(common.mustCall());
|
||||
|
||||
// Check inspection of the instance
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user