karma-runner / karma-runner/karma

Karma Firefox Launcher Fails and Passes at the Same Time

Open
#1,431 1 comment 0 reactions 0 assignees View on GitHub
needs: investigation
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

I have a test that uses karma and karma-mocha. Using the Chrome launcher it works. However, the Firefox launcher fails.

```
Firefox 38.0.0 (Mac OS X 10.10) ItemBox component level event handlers should support onBlur FAILED
Error: expected false to be truthy (/var/folders/gt/8h796z8x73s73cb2t239d2240000gn/T/d0b4e279a0759c5dfb303ffb28990ddf.browserify:98:0 <- node_modules/expect.js/index.js:96:0)
```

(note: I'm using karma-browserify, so the stack trace coming from Firefox is useless, Chrome is fine though)

When inspecting in the Firefox debug console, it shows all my debug statements and a message that the test passed.

```
"SUCCESS ItemBox component level event handlers should support onBlur" debug.html:35:0
"Skipped 0 tests"
```

I know the code works because when I interact with it in the debug tab of the karma launched firefox, the correct console messages appear.

Due to the nature of the code I'm using Mocha's `done` param and `setTimeout`s in the test, but that has is not a problem in other tests.

Does anybody have any idea why the inspector console says "SUCCESS" but the Terminal window says "FAILED"?

Note: I hope to reduce my code to a point I can post it here soon, but maybe in the meantime somebody can let me know if this is a known problem. I searched using google, and on the karma and karma-firefox-launcher issues section on GitHub. However, I came up empty on this particular bug.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ItemBox component test with the Firefox launcher, karma-mocha, and karma-browserify, comparing the terminal result with Firefox's debug console. Inspect the test's Mocha done callback and setTimeout usage, then reduce the case as described. Done means Firefox reports the same result consistently in both places.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.