Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor experimental-modules check into runMain #21350

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash! add test for cjs execution stalling
  • Loading branch information
addaleax authored and guybedford committed Jun 21, 2018
commit 2a0dd2dca8d583e68a7de3984bae15799f9e3a28
10 changes: 5 additions & 5 deletions test/es-module/test-esm-cjs-main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
const fixtures = require('../common/fixtures');
const { spawn } = require('child_process');
const assert = require('assert');
const path = require('path');

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

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