diff --git a/spec/fixtures/module/inspector-binding.js b/spec/fixtures/module/inspector-binding.js index 09aace66e09a7..64505429508bd 100644 --- a/spec/fixtures/module/inspector-binding.js +++ b/spec/fixtures/module/inspector-binding.js @@ -1,5 +1,6 @@ const inspector = require('inspector') const path = require('path') +const { pathToFileURL } = require('url') // This test case will set a breakpoint 4 lines below function debuggedFunction () { @@ -51,21 +52,13 @@ function testSampleDebugSession () { } const session = new inspector.Session() session.connect() - let secondSessionOpened = false - const secondSession = new inspector.Session() - try { - secondSession.connect() - secondSessionOpened = true - } catch (error) { - // expected as the session already exists - } session.on('Debugger.paused', (notification) => debuggerPausedCallback(session, notification)) let cbAsSecondArgCalled = false session.post('Debugger.enable', () => { cbAsSecondArgCalled = true }) session.post('Debugger.setBreakpointByUrl', { - 'lineNumber': 8, - 'url': path.resolve(__dirname, __filename), + 'lineNumber': 9, + 'url': pathToFileURL(path.resolve(__dirname, __filename)).toString(), 'columnNumber': 0, 'condition': '' }) @@ -76,7 +69,6 @@ function testSampleDebugSession () { process.send({ 'cmd': 'assert', 'debuggerEnabled': cbAsSecondArgCalled, - 'secondSessionOpened': secondSessionOpened, 'success': (cur === 5) && (failures.length === 0) }) } diff --git a/spec/node-spec.js b/spec/node-spec.js index edff640e6d588..1577172060041 100644 --- a/spec/node-spec.js +++ b/spec/node-spec.js @@ -265,10 +265,9 @@ describe('node feature', () => { stdio: ['ipc'] }) - child.on('message', ({ cmd, debuggerEnabled, secondSessionOpened, success }) => { + child.on('message', ({ cmd, debuggerEnabled, success }) => { if (cmd === 'assert') { expect(debuggerEnabled).to.be.true() - expect(secondSessionOpened).to.be.true() expect(success).to.be.true() done() }