Search code examples
unit-testingphantomjskarma-runnerkarma-jasminekarma-mocha

Explain karma unit test times


I've been searching the web for this for two days and I found nothing. Maybe I'm looking in the wrong way — I don't know...

So here it is: what are the times on my console when running a Karma+Jasmine+phantomJs unit test?

... Executed 1 of 1 SUCCESS (0.878 secs / 0.112 secs)

First, I though that the second time is the total unit test time (for example, when running multiple tasks), however, sometimes the first time gets to be 'bigger', sometimes not...

Anyone?


Solution

  • total time / net time

    • net time = only test execution (in the browser)
    • total time = how long it took since Karma noticed the file change till the final result was printed (net time + communication with the browser + loading the files in the browser)

    See karma/lib/reporters/base.js