Skip to content

Commit 635e1a0

Browse files
Trottdanielleadams
authored andcommitted
test: add test-debugger-breakpoint-exists
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>
1 parent 6c375e1 commit 635e1a0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
common.skipIfInspectorDisabled();
6+
7+
const fixtures = require('../common/fixtures');
8+
const startCLI = require('../common/debugger');
9+
10+
// Test for "Breakpoint at specified location already exists" error.
11+
{
12+
const script = fixtures.path('debugger', 'three-lines.js');
13+
const cli = startCLI([script]);
14+
15+
function onFatal(error) {
16+
cli.quit();
17+
throw error;
18+
}
19+
20+
cli.waitForInitialBreak()
21+
.then(() => cli.waitForPrompt())
22+
.then(() => cli.command('setBreakpoint(1)'))
23+
.then(() => cli.command('setBreakpoint(1)'))
24+
.then(() => cli.waitFor(/Breakpoint at specified location already exists/))
25+
.then(() => cli.quit())
26+
.then(null, onFatal);
27+
}

0 commit comments

Comments
 (0)