Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/parallel/test-debugger-auto-resume.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ addLibraryPath(process.env);

const cli = startCLI([script], [], { env });

await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.deepStrictEqual(cli.breakInfo, {
filename: script,
line: 10,
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-backtrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const path = require('path');

async function runTest() {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.stepCommand('c');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-break.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);

(async () => {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.deepStrictEqual(
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-breakpoint-exists.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const cli = startCLI([script]);

(async () => {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('setBreakpoint(1)');
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-debugger-clear-breakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const path = require('path');
throw error;
}

return cli.waitForInitialBreak()
return cli.waitForPrompt()
.then(() => cli.waitForInitialBreak())
.then(() => cli.waitForPrompt())
.then(() => cli.command('sb("break.js", 3)'))
.then(() => cli.command('sb("break.js", 9)'))
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debugger-exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const path = require('path');

(async () => {
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });

Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-exec-scope.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import assert from 'assert';
const cli = startCLI([fixtures.path('debugger/backtrace.js')]);

try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.stepCommand('c');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const cli = startCLI([fixtures.path('debugger/alive.js')]);

async function waitInitialBreak() {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec [typeof heartbeat, typeof process.exit]');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-extract-function-name.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import assert from 'assert';
const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]);

try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec a = function func() {}; a;');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-heap-profiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const filename = tmpdir.resolve('node.heapsnapshot');

async function waitInitialBreak() {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('takeHeapSnapshot()');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-help.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import assert from 'assert';
const cli = startCLI([fixtures.path('debugger', 'empty.js')]);

try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('help');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const assert = require('assert');
const cli = startCLI([fixtures.path('debugger/three-lines.js')]);

(async () => {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('list(0)');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-low-level.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const assert = require('assert');

async function testDebuggerLowLevel() {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('scripts');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-object-type-remote-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const assert = require('assert');
const cli = startCLI([fixtures.path('debugger/empty.js')]);

(async () => {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec new Date(0)');
Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-debugger-preserve-breaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const script = path.relative(process.cwd(), scriptFullPath);
(async () => {
const cli = startCLI([script]);
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('breakpoints');
Expand All @@ -29,7 +30,9 @@ const script = path.relative(process.cwd(), scriptFullPath);
await cli.stepCommand('c'); // hit line 3
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 3 });
await cli.command('restart');
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 1 });
await cli.stepCommand('c');
assert.deepStrictEqual(cli.breakInfo, { filename: script, line: 2 });
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-profile-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const cli = startCLI([fixtures.path('debugger/empty.js')]);
const rootDir = path.resolve(__dirname, '..', '..');

(async () => {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('profile');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function delay(ms) {

try {
(async () => {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('exec console.profile()');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI(['--inspect-port=0', script], [], {}, { randomPort: false });

(async () => {
await cli.waitForInitialBreak();
await cli.waitFor(/Debugger attached\./);
await cli.waitForPrompt();
assert.match(cli.output, /debug>/, 'prints a prompt');
assert.match(
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-debugger-random-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const assert = require('assert');

const cli = startCLI([script]);

cli.waitForInitialBreak()
cli.waitForPrompt()
.then(() => cli.waitForInitialBreak())
.then(() => cli.waitForPrompt())
.then(() => {
assert.match(cli.output, /debug>/, 'prints a prompt');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-restart-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const startCLI = require('../common/debugger');

async function onWaitForInitialBreak() {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-debugger-run-after-quit-restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const path = require('path');
const script = path.relative(process.cwd(), scriptFullPath);
const cli = startCLI([script]);

cli.waitForInitialBreak()
cli.waitForPrompt()
.then(() => cli.waitForInitialBreak())
.then(() => cli.waitForPrompt())
.then(() => cli.stepCommand('n'))
.then(() => {
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-sb-before-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const otherScript = path.relative(process.cwd(), otherScriptFullPath);
const cli = startCLI([script]);

(async () => {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('sb("other.js", 2)');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const assert = require('assert');

(async () => {
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('scripts');
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-set-context-line-number.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function getLastLine(output) {

// Stepping through breakpoints.
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();

Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-debugger-use-strict.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const assert = require('assert');
throw error;
}

return cli.waitForInitialBreak()
return cli.waitForPrompt()
.then(() => cli.waitForInitialBreak())
.then(() => cli.waitForPrompt())
.then(() => {
const brk = cli.breakInfo;
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-debugger-watch-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const assert = require('assert');
const cli = startCLI([fixtures.path('debugger/break.js')]);

(async () => {
await cli.waitForInitialBreak();
await cli.waitFor(/Debugger attached\./);
await cli.waitForPrompt();
await cli.command('watch()');
await cli.waitFor(/ERR_INVALID_ARG_TYPE/);
assert.match(cli.output, /TypeError \[ERR_INVALID_ARG_TYPE\]: The "expression" argument must be of type string\. Received undefined/);
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-debugger-watchers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function onFatal(error) {

// Stepping through breakpoints.
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('watch("x")');
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-debugger-custom-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([`--port=${common.PORT}`, script], [], {}, { randomPort: false });
(async function() {
try {
await cli.waitForInitialBreak();
await cli.waitFor(/Debugger attached\./);
await cli.waitForPrompt();
assert.match(cli.output, /debug>/, 'prints a prompt');
assert.match(
Expand Down
1 change: 1 addition & 0 deletions test/sequential/test-debugger-launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import assert from 'assert';
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script], [], {}, { randomPort: false });
try {
await cli.waitForPrompt();
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.match(cli.output, /debug>/, 'prints a prompt');
Expand Down
Loading