chore: add spec for --inspect after a -- ()

This commit is contained in:
Samuel Attard 2018-11-21 08:23:50 +11:00 committed by Shelley Vohr
parent de05ff894b
commit f02f9ba9fb
2 changed files with 19 additions and 0 deletions
spec
fixtures/module
node-spec.js

1
spec/fixtures/module/noop.js vendored Normal file
View file

@ -0,0 +1 @@
process.exit(0)

View file

@ -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: {