mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
6c375e18b6
commit
635e1a0274
1 file changed
+27
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user