test: replaces fixturesDir with fixtures
PR-URL: https://github.com/nodejs/node/pull/15838 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
parent
c7d291366e
commit
7ba896e407
@ -1,24 +1,27 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
const fixtures = require('../common/fixtures');
|
||||||
|
|
||||||
common.skipIfInspectorDisabled();
|
common.skipIfInspectorDisabled();
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const execFile = require('child_process').execFile;
|
const execFile = require('child_process').execFile;
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
const mainScript = path.join(common.fixturesDir, 'loop.js');
|
const mainScript = fixtures.path('loop.js');
|
||||||
const expected =
|
const expected =
|
||||||
'`node --debug` and `node --debug-brk` are invalid. ' +
|
'`node --debug` and `node --debug-brk` are invalid. ' +
|
||||||
'Please use `node --inspect` or `node --inspect-brk` instead.';
|
'Please use `node --inspect` or `node --inspect-brk` instead.';
|
||||||
for (const invalidArg of ['--debug-brk', '--debug']) {
|
for (const invalidArg of ['--debug-brk', '--debug']) {
|
||||||
execFile(
|
execFile(
|
||||||
process.execPath,
|
process.execPath,
|
||||||
[ invalidArg, mainScript ],
|
[invalidArg, mainScript],
|
||||||
common.mustCall((error, stdout, stderr) => {
|
common.mustCall((error, stdout, stderr) => {
|
||||||
assert.strictEqual(error.code, 9, `node ${invalidArg} should exit 9`);
|
assert.strictEqual(error.code, 9, `node ${invalidArg} should exit 9`);
|
||||||
assert.strictEqual(stderr.includes(expected), true,
|
assert.strictEqual(
|
||||||
`${stderr} should include '${expected}'`);
|
stderr.includes(expected),
|
||||||
|
true,
|
||||||
|
`${stderr} should include '${expected}'`
|
||||||
|
);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user