Skip to content

Commit ec7e853

Browse files
committed
doc(debug): add instructions for debugging the tests in the README
1 parent 91f50b6 commit ec7e853

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,21 @@ Notes:
7070
the transpiler specs),
7171
- You can also add `debugger;` statements in the specs (JavaScript). The execution will halt when
7272
the developer tools are opened in the browser running Karma.
73+
74+
## Debug the tests
75+
76+
If you need to debug the tests:
77+
78+
- add a `debugger;` statement to the test you want to debug (oe the source code),
79+
- execute karma `node_modules/karma/bin/karma start karma-js.conf.js`,
80+
- press the top right "DEBUG" button,
81+
- open the dev tools and press F5,
82+
- the execution halt at the `debugger;` statement
83+
84+
Note (WebStorm users):
85+
You can create a Karma run config from WebStorm.
86+
Then in the "Run" menu, press "Debug 'karma-js.conf.js'", WebStorm will stop in the generated code
87+
on the `debugger;` statement.
88+
You can then step into the code and add watches.
89+
The `debugger;` statement is needed because WebStorm will stop in a transpiled file. Breakpoints in
90+
the original source files are not supported at the moment.

0 commit comments

Comments
 (0)