I'm currently trying to implement jasmine testing using karma and webpack, and the code is getting transpiled incorrectly, but I can't see what it is transpiled down to because the browser closes as soon as it opens and finds the syntax error. How can I configure karma or jasmine to keep the browser window open after an error occurs?
Asked
Active
Viewed 1.5k times
18
-
1--single-run should do the trick for you, or { singleRun: false } in karma.conf.js – Anatoli Klamer Mar 02 '17 at 19:36
-
@zxxc when I set singleRun to false, it opens the browser window and doesn't seem to load the tests. – James G. Mar 02 '17 at 19:40
1 Answers
24
You want to call it with --single-run=false
.
Try following this article: https://glebbahmutov.com/blog/debugging-karma-unit-tests/

Stout01
- 1,116
- 1
- 10
- 20
-
This started working today, but it was not running the tests with this yesterday. Maybe restarting my computer affected the change? – James G. Mar 04 '17 at 00:45
-
If the option is not good enough for you: Try using Gulp plus Karma APIs browsers_change event: https://stackoverflow.com/questions/45352256/how-to-keep-browser-window-open-for-single-karma-run-until-i-close-it-once/45375346#45375346 – Stefan Jul 28 '17 at 13:58
-
8
-
3for the unknown option error, check https://stackoverflow.com/questions/50816917/angular-cli-6-unknown-option-singlerun – Manu Chadha Oct 13 '20 at 05:57
-
1
-