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?
With the default settings in place, just point your browser to http://localhost:9876/ . This allows you to capture a browser on any device, such as a tablet or a phone, that is on the same network as the machine running Karma (or using a local tunnel).
Recent versions of Karma have gained a few new options and the following options in your karma.config.js will help alleviate these issues: // to avoid DISCONNECTED messages browserDisconnectTimeout : 10000, // default 2000 browserDisconnectTolerance : 1, // default 0 browserNoActivityTimeout : 4*60*1000 //default 10000 ...
Just simply add into the configuration file: browsers = ['Chrome']; Then, Karma will take care of autocapturing these browsers, as well as killing them.
You want to call it with --single-run=false
.
Try following this article: https://glebbahmutov.com/blog/debugging-karma-unit-tests/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With