File tree 4 files changed +38
-1
lines changed
4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 2
2
# However, in order to prevent issues, they are ignored here.
3
3
.DS_STORE
4
4
.idea
5
- .vscode
5
+ .vscode /*
6
+ ! .vscode /launch.json
6
7
* .log
7
8
* .tsbuildinfo
8
9
/.eslintcache
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 0.2.0" ,
3
+ "configurations" : [
4
+ {
5
+ "type" : " node" ,
6
+ "request" : " launch" ,
7
+ "name" : " Test Current File" ,
8
+ "program" : " test/cli.js" ,
9
+ "args" : [" ${relativeFile}" , " --inspecting" ],
10
+ "console" : " integratedTerminal" ,
11
+ "internalConsoleOptions" : " neverOpen" ,
12
+ "disableOptimisticBPs" : true
13
+ }
14
+ ]
15
+ }
Original file line number Diff line number Diff line change @@ -112,6 +112,14 @@ trade-off, mainly completeness vs. speed.
112
112
113
113
### React API level
114
114
115
+ #### Debugging tests
116
+
117
+ If you want to debug tests with the e.g. Chrome inspector (chrome://inspect) you can run ` yarn t < testFilePattern> -- debug` .
118
+ Note that the test will not get executed until you start code execution in the inspector.
119
+
120
+ We have a dedicated task to use VSCode's integrated debugger to debug the currently opened test file.
121
+ Open the test you want to run and press F5 (launch "Test Current File").
122
+
115
123
#### Run the core mocha unit/integration test suite.
116
124
117
125
To run all of the unit and integration tests run ` yarn test: unit`
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ async function run(argv) {
39
39
if ( argv . bail ) {
40
40
args . push ( '--bail' ) ;
41
41
}
42
+ if ( argv . debug || argv . inspecting ) {
43
+ args . push ( '--timeout 0' ) ;
44
+ }
42
45
if ( argv . debug ) {
43
46
args . push ( '--inspect-brk' ) ;
44
47
}
86
89
description : 'Stop on first error.' ,
87
90
type : 'boolean' ,
88
91
} )
92
+ . option ( 'debug' , {
93
+ alias : 'd' ,
94
+ description :
95
+ 'Allows attaching a debugger and waits for the debugger to start code execution.' ,
96
+ type : 'boolean' ,
97
+ } )
98
+ . option ( 'inspecting' , {
99
+ description : 'In case you expect to hit breakpoints that may interrupt a test.' ,
100
+ type : 'boolean' ,
101
+ } )
89
102
. option ( 'production' , {
90
103
alias : 'p' ,
91
104
description :
You can’t perform that action at this time.
0 commit comments