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.

PR-URL: #39570
Refs: https://github.com/nodejs/node-inspect/issues/101
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Trott authored and nodejs-github-bot committed Aug 1, 2021
1 parent 1c6f26d commit 42d3144
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/sequential/test-debugger-breakpoint-exists.js
Original file line number Diff line number Diff line change
@@ -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 42d3144

Please sign in to comment.