question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reporter's onSpecComplete is called after onRunComplete

See original GitHub issue

Reproduced on this test.js:

function wait(millis) {
  var startTime = new Date().getTime();
  while (new Date().getTime() < startTime + millis) {}
}

describe("suite", function () {
  it("wait 1 sec", function () {
    wait(1000);
  });
  it("wait 11 sec", function () {
    wait(11000);
  });
  it("wait 1 sec again", function () {
    wait(1000);
  });
});

Test wait 11 sec takes 11 sec to execute, so the browser is disconnected:

WARN [Chrome 38.0.2125 (Linux)]: Disconnected (1 times), because no message in 10000 ms.

The problem is that, for some reason, onSpecComplete is called after onRunComplete. Is it expected or a bug?

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
svieiracommented, Sep 6, 2016

Still seeing it here - karma@1.2.0 and karma-junit-reporter@1.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create a Custom Karma Reporter - ironSource
This reporter will do the following things: write “Hello Word” when the execution starts; write “Hello ” + browser name when starting to...
Read more >
Initial import · 8b4416c7aa - karma-subunit-reporter - OpenDev ...
karma-subunit-reporter - A karma plugin to report Karma test results as a subunit stream. ... onSpecComplete = function(browser, result) {.
Read more >
Angular Unit testing : can't change the reporter of karma
I am trying to use the JUnit reporter with karma. When I launch $ ng test --watch=false --code-coverage. It always outputs me
Read more >
Code coverage report for node-npmtest-karma-mocha-reporter ...
maxLogLines = 999; } // check if mocha is installed when showDiff is enabled if (config. ... the onRunComplete() method is called twice...
Read more >
JavaScript Test Runner - UNPKG
name or calling a non existing method on an object - developers have to ... Tests prove whether the code still works, even...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found