-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: replaces fixturesDir with fixtures
PR-URL: #15838 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
- Loading branch information
1 parent
50cae5c
commit b1e6373
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const fixtures = require('../common/fixtures'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
|
||
const assert = require('assert'); | ||
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 = | ||
'`node --debug` and `node --debug-brk` are invalid. ' + | ||
'Please use `node --inspect` or `node --inspect-brk` instead.'; | ||
for (const invalidArg of ['--debug-brk', '--debug']) { | ||
execFile( | ||
process.execPath, | ||
[ invalidArg, mainScript ], | ||
[invalidArg, mainScript], | ||
common.mustCall((error, stdout, stderr) => { | ||
assert.strictEqual(error.code, 9, `node ${invalidArg} should exit 9`); | ||
assert.strictEqual(stderr.includes(expected), true, | ||
`${stderr} should include '${expected}'`); | ||
assert.strictEqual( | ||
stderr.includes(expected), | ||
true, | ||
`${stderr} should include '${expected}'` | ||
); | ||
}) | ||
); | ||
} |