karma-runner / karma

Spectacular Test Runner for JavaScript
http://karma-runner.github.io
MIT License
11.95k stars 1.71k forks source link

Karma Firefox Launcher Fails and Passes at the Same Time #1431

Open HurricaneJames opened 9 years ago

HurricaneJames commented 9 years ago

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

nickpresta commented 8 years ago

I'm noticing something very similar -- I get 34 "failures" reported in the console (which pass on Chrome/PhantomJS) and inside the Firefox console all "failures" are passing.

I'm using karma, webpack, karma-firefox-launcher, and Jasmine.

I don't have a code sample off hand that can illustrate the issue, but I'm posting for visibility.