Skip to content

Commit

Permalink
test: add test-debugger-breakpoint-exists
Browse files Browse the repository at this point in the history
This adds test coverage to `unpackError()` in
`lib/internal/debugger/inspect_client.js`. That function previously was
untested.
  • Loading branch information
Trott committed Jul 29, 2021
1 parent c6829ec commit 30d00ef
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/sequential/test-debugger-breakpoint-exists.js
@@ -0,0 +1,27 @@
'use strict';

const common = require('../common');

common.skipIfInspectorDisabled();

const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');

// Test for "Breakpoint at specified location already exists" error.
{
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);

function onFatal(error) {
cli.quit();
throw error;
}

cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.command('setBreakpoint(1)'))
.then(() => cli.command('setBreakpoint(1)'))
.then(() => cli.waitFor(/Breakpoint at specified location already exists/))
.then(() => cli.quit())
.then(null, onFatal);
}

0 comments on commit 30d00ef

Please sign in to comment.