mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
c3204a8787
This un-breaks testing in the case of `./configure --debug-node`. PR-URL: https://github.com/nodejs/node/pull/32422 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
33 lines
868 B
JavaScript
33 lines
868 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
const assert = require('assert');
|
|
const child_process = require('child_process');
|
|
const path = require('path');
|
|
|
|
common.allowGlobals(global.require);
|
|
let binary = `out/${common.buildType}/embedtest`;
|
|
if (common.isWindows) {
|
|
binary += '.exe';
|
|
}
|
|
binary = path.resolve(__dirname, '..', '..', binary);
|
|
|
|
assert.strictEqual(
|
|
child_process.spawnSync(binary, ['console.log(42)'])
|
|
.stdout.toString().trim(),
|
|
'42');
|
|
|
|
assert.strictEqual(
|
|
child_process.spawnSync(binary, ['throw new Error()']).status,
|
|
1);
|
|
|
|
assert.strictEqual(
|
|
child_process.spawnSync(binary, ['process.exitCode = 8']).status,
|
|
8);
|
|
|
|
|
|
const fixturePath = JSON.stringify(fixtures.path('exit.js'));
|
|
assert.strictEqual(
|
|
child_process.spawnSync(binary, [`require(${fixturePath})`, 92]).status,
|
|
92);
|