chore: add spec for --inspect after a -- (#15237)
This commit is contained in:
parent
de05ff894b
commit
f02f9ba9fb
2 changed files with 19 additions and 0 deletions
spec
1
spec/fixtures/module/noop.js
vendored
Normal file
1
spec/fixtures/module/noop.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
process.exit(0)
|
|
@ -239,6 +239,24 @@ describe('node feature', () => {
|
|||
child.stdout.on('data', outDataHandler)
|
||||
})
|
||||
|
||||
it('does not start the v8 inspector when --inspect is after a -- argument', (done) => {
|
||||
child = ChildProcess.spawn(remote.process.execPath, [path.join(__dirname, 'fixtures', 'module', 'noop.js'), '--', '--inspect'])
|
||||
|
||||
let output = ''
|
||||
function dataListener (data) {
|
||||
output += data
|
||||
}
|
||||
child.stderr.on('data', dataListener)
|
||||
child.stdout.on('data', dataListener)
|
||||
child.on('exit', () => {
|
||||
if (output.trim().startsWith('Debugger listening on ws://')) {
|
||||
done(new Error('Inspector was started when it should not have been'))
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('supports js binding', (done) => {
|
||||
child = ChildProcess.spawn(process.execPath, ['--inspect', path.join(__dirname, 'fixtures', 'module', 'inspector-binding.js')], {
|
||||
env: {
|
||||
|
|
Loading…
Add table
Reference in a new issue