I just started with unit test my angular app with karma. Everything working as expected
Chrome 26.0 (Windows): Executed 1 of 1
Chrome 26.0 (Windows): Executed 1 of 1 SUCCESS (0.878 secs / 0.112 secs)
However, is there any way to output more info about the result of the test. For example, Suite and test names it is executing and their result. I've read few tutorials where Jasmine test result outputs in browser. I'm wondering it can be achieved in karma too.
Karma is a test runner for JavaScript that runs on Node. js. It is very well suited to testing AngularJS or any other JavaScript projects. Using Karma to run tests using one of many popular JavaScript testing suites (Jasmine, Mocha, QUnit, etc.)
You need to run it with singleRun = false in karma. conf. js and then click the button on the top corner that says "DEBUG". Then you should see the output and it won't disappear or close.
Comparing test execution time, I found that Jest runs unit tests at 2x to 3x the speed of Karma. This can be drastic as your project becomes larger and the amount of test cases skyrocket.
I was looking for something similar, and found this: https://github.com/usrz/javascript-karma-verbose-reporter. Generates this kind of output:
$ karma start --reporters=verbose Suites and tests results: - the app.router.config module : * contains a router property : ok * configures the router title : ok * should have a login route : ok - the organization module : * contains a state property : ok * should have a streams route after configuration : ok * when activated, should set state based on organization in route : ok - the streams module : * points to state : ok * loads organization streams upon activation : ok * loads organization streams via API : ok Browser results: - PhantomJS 1.9.8 (Mac OS X 0.0.0): 9 tests - 9 ok
To make this a default option, you can add this to your karma config, e.g.:
reporters: ['verbose', 'junit']
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