Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you tell Karma to keep browser window open if tests fail?

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?

like image 583
James G. Avatar asked Mar 02 '17 19:03

James G.


People also ask

How do I run karma in my browser?

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).

What is the default capture timeout in karma?

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 ...

How do you Autocapture in karma?

Just simply add into the configuration file: browsers = ['Chrome']; Then, Karma will take care of autocapturing these browsers, as well as killing them.


1 Answers

You want to call it with --single-run=false.

Try following this article: https://glebbahmutov.com/blog/debugging-karma-unit-tests/

like image 55
Stout01 Avatar answered Oct 11 '22 19:10

Stout01