Skip to content

Commit 2a0dd2d

Browse files
addaleaxguybedford
authored andcommitted
squash! add test for cjs execution stalling
1 parent f9d777f commit 2a0dd2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/es-module/test-esm-cjs-main.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
4+
const fixtures = require('../common/fixtures');
45
const { spawn } = require('child_process');
56
const assert = require('assert');
6-
const path = require('path');
77

8-
const entry = path.resolve(__dirname, '../fixtures/es-modules/cjs.js');
8+
const entry = fixtures.path('/es-modules/cjs.js');
99

1010
const child = spawn(process.execPath, ['--experimental-modules', entry]);
1111
let experimentalWarning = false;
@@ -21,7 +21,7 @@ child.stdout.on('data', (data) => {
2121
assert.strictEqual(data.toString(), 'executed\n');
2222
validatedExecution = true;
2323
});
24-
child.on('close', (code, stdout) => {
24+
child.on('close', common.mustCall((code, stdout) => {
2525
assert.strictEqual(validatedExecution, true);
2626
assert.strictEqual(code, 0);
27-
});
27+
}));

0 commit comments

Comments
 (0)