File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ let x = 0 ;
2+ x = 1 ;
3+ x = 2 ;
4+ x = 3 ;
5+ x = 4 ;
6+ x = 5 ;
7+ x = 6 ;
8+ x = 7 ;
9+ x = 8 ;
10+ x = 9 ;
11+ x = 10 ;
12+ x = 11 ;
13+ x = 12 ;
14+ x = 13 ;
15+ x = 14 ;
16+ x = 15 ;
17+ x = 16 ;
18+ x = 17 ;
19+ x = 18 ;
20+ module . exports = x ;
Original file line number Diff line number Diff line change 1+ import { skipIfInspectorDisabled } from '../common/index.mjs' ;
2+ skipIfInspectorDisabled ( ) ;
3+
4+ import { path } from '../common/fixtures.mjs' ;
5+ import startCLI from '../common/debugger.js' ;
6+
7+ import assert from 'assert' ;
8+
9+ const script = path ( 'debugger' , 'twenty-lines.js' ) ;
10+ const cli = startCLI ( [ script ] ) ;
11+
12+ function onFatal ( error ) {
13+ cli . quit ( ) ;
14+ throw error ;
15+ }
16+
17+ // Stepping through breakpoints.
18+ try {
19+ await cli . waitForInitialBreak ( ) ;
20+ await cli . waitForPrompt ( ) ;
21+
22+ // Make sure the initial value is 2.
23+ await cli . stepCommand ( 'n' ) ;
24+ assert . ok ( cli . output . includes ( "4 x = 3;" ) ) ;
25+
26+ await cli . command ( 'setContextLineNumber(5)' ) ;
27+ await cli . stepCommand ( 'n' ) ;
28+ assert . ok ( cli . output . includes ( "8 x = 7;" ) ) ;
29+
30+ await cli . command ( 'setContextLineNumber(3)' ) ;
31+ await cli . stepCommand ( 'n' ) ;
32+ assert . ok ( cli . output . includes ( "7 x = 6;" ) ) ;
33+
34+ await cli . command ( 'list(3)' ) ;
35+ await cli . stepCommand ( 'n' ) ;
36+ assert . ok ( cli . output . includes ( "7 x = 6;" ) ) ;
37+
38+ await cli . quit ( ) ;
39+ } catch ( error ) {
40+ onFatal ( error ) ;
41+ }
You can’t perform that action at this time.
0 commit comments