Skip to content

Commit d1af4cb

Browse files
committed
test: add test for watch(index) command
1 parent 22a5f23 commit d1af4cb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/sequential/test-debugger-watchers.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,27 @@ const assert = require('assert');
2929
.then(() => cli.command('watchers'))
3030
.then(() => {
3131
assert.match(cli.output, /x is not defined/);
32+
assert.match(cli.output, /1: "Hello" = 'Hello'/);
33+
assert.match(cli.output, /2: 42 = 42/);
34+
assert.match(cli.output, /3: NaN = NaN/);
35+
assert.match(cli.output, /4: true = true/);
36+
assert.match(cli.output, /5: \[1, 2\] = \[ 1, 2 \]/);
37+
assert.match(
38+
cli.output,
39+
/6: process\.env =\n\s+\{[\s\S]+,\n\s+\.\.\. \}/,
40+
'shows "..." for process.env');
3241
})
42+
.then(() => cli.command('unwatch(4)'))
3343
.then(() => cli.command('unwatch("42")'))
3444
.then(() => cli.stepCommand('n'))
3545
.then(() => {
3646
assert.match(cli.output, /0: x = 10/);
3747
assert.match(cli.output, /1: "Hello" = 'Hello'/);
3848
assert.match(cli.output, /2: NaN = NaN/);
39-
assert.match(cli.output, /3: true = true/);
40-
assert.match(cli.output, /4: \[1, 2\] = \[ 1, 2 \]/);
49+
assert.match(cli.output, /3: \[1, 2\] = \[ 1, 2 \]/);
4150
assert.match(
4251
cli.output,
43-
/5: process\.env =\n\s+\{[\s\S]+,\n\s+\.\.\. \}/,
52+
/4: process\.env =\n\s+\{[\s\S]+,\n\s+\.\.\. \}/,
4453
'shows "..." for process.env');
4554
})
4655
.then(() => cli.quit())

0 commit comments

Comments
 (0)