diff --git a/test/sequential/test-debugger-breakpoint-exists.js b/test/sequential/test-debugger-breakpoint-exists.js new file mode 100644 index 00000000000000..111dc62ca82236 --- /dev/null +++ b/test/sequential/test-debugger-breakpoint-exists.js @@ -0,0 +1,36 @@ +'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.waitFor(/listening/)) + .then(() => cli.waitFor(/attached/)) + .then(() => cli.waitFor(/Break on/)) + .then(() => cli.waitForPrompt()) + .then(() => cli.command('setBreakpoint(1)')) + .then(() => cli.command('restart')) + .then(() => cli.waitFor(/listening/)) + .then(() => cli.waitFor(/attached/)) + .then(() => cli.waitFor(/Break on/)) + .then(() => cli.waitForPrompt()) + .then(() => cli.command('setBreakpoint(1)')) + .then(() => cli.command('restart')) + .then(() => cli.waitFor(/Breakpoint at specified location already exists/)) + .then(() => cli.quit()) + .then(null, onFatal); +}