jasmine / jasmine-gem

Jasmine ruby gem
682 stars 275 forks source link

"0 specs, 0 failures" when running with jasmine:ci #249

Closed defrex closed 9 years ago

defrex commented 9 years ago

When I run rake jasmine and request the resulting server, my tests run without issue. However, when I run rake jasmine:ci there is no error, but also no tests are run: "0 specs, 0 failures".

I threw a breakpoint in Jasmine::CiRunner so I could request the same URL as phantom (from Chrome). It runs one test (which passes), then errors out with the following:

Uncaught TypeError: this.expectationResultFactory is not a function
Suite.onException @ jasmine.js:2103
TreeProcessor.execute.queueRunnerFactory.onException @ jasmine.js:2213
onException @ jasmine.js:1827
handleException @ jasmine.js:1831
attemptAsync @ jasmine.js:1821
QueueRunner.run @ jasmine.js:1774
QueueRunner.execute @ jasmine.js:1762
queueRunnerFactory @ jasmine.js:627T
reeProcessor.execute @ jasmine.js:2209
execute @ jasmine.js:678
window.onload @ boot.js:132
slackersoft commented 9 years ago

What version(s) of jasmine are you running (both the jasmine gem and jasmine-core)? Do you have an example suite that exhibits this behavior?

The jasmine gem should be serving exactly the same javascript for both the normal server task as well as the ci task. We do have a story in tracker to make it so that global beforeAll and afterAll can support expectations that might fix your problem if you are doing that.

defrex commented 9 years ago

After a bunch more digging, this turned out to be the issue with PhantomJS not supporting bind.

That said, ideally JS errors outside of specs would trigger a test failure in the CI runner. I had to run Phantom with remote debugging turned on to figure this out.