-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inspector: allow opening inspector when
NODE_V8_COVERAGE
is set
PR-URL: #46113 Fixes: #46110 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const assert = require('assert'); | ||
const inspector = require('inspector'); | ||
|
||
|
||
assert.strictEqual(inspector.url(), undefined); | ||
inspector.open(0, undefined, false); | ||
assert(inspector.url().startsWith('ws://')); | ||
assert.throws(() => { | ||
inspector.open(0, undefined, false); | ||
}, { | ||
code: 'ERR_INSPECTOR_ALREADY_ACTIVATED' | ||
}); | ||
inspector.close(); | ||
assert.strictEqual(inspector.url(), undefined); |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const { spawnSync } = require('child_process'); | ||
const fixtures = require('../common/fixtures'); | ||
const tmpdir = require('../common/tmpdir'); | ||
|
||
common.skipIfInspectorDisabled(); | ||
common.skipIfWorker(); | ||
|
||
tmpdir.refresh(); | ||
|
||
|
||
let output = spawnSync(process.execPath, [fixtures.path('inspector-open.js')]); | ||
assert.strictEqual(output.status, 0); | ||
|
||
output = spawnSync(process.execPath, [fixtures.path('inspector-open.js')], { | ||
env: { ...process.env, NODE_V8_COVERAGE: tmpdir.path }, | ||
}); | ||
assert.strictEqual(output.status, 0); |