mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 15:30:56 +01:00
796f3d0af4
PR-URL: https://github.com/nodejs/node/pull/29866 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
22 lines
592 B
JavaScript
22 lines
592 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
const { spawn } = require('child_process');
|
|
const assert = require('assert');
|
|
|
|
const entry = fixtures.path('/es-modules/cjs.js');
|
|
|
|
const child = spawn(process.execPath, [entry]);
|
|
child.stderr.setEncoding('utf8');
|
|
let stdout = '';
|
|
child.stdout.setEncoding('utf8');
|
|
child.stdout.on('data', (data) => {
|
|
stdout += data;
|
|
});
|
|
child.on('close', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, 0);
|
|
assert.strictEqual(signal, null);
|
|
assert.strictEqual(stdout, 'executed\n');
|
|
}));
|