az7ar
az7ar

Reputation: 5237

phantom-jasmine can not find specs

I am trying to use phantom-jasmine. I have installed phantomjs (1.9.1) on my systems ( Mountain Lion and Ubuntu) and phantom-jasmine using npm.

The problem is when I try to run phantom-jasmine examples/TestRunner.html from their example I am getting 0 specs, 0 failures although it should be 3 specs, 1 failures in the output.

If I open the TestRunner.html from a browser it is behaving as expected but phantom-jasmine cant seem to find the specs.

Another thing is when I provide the absolute path (phantom-jasmine /home/me/phantom-jasmine/examples/TestRunner.html to the TestRunner.html this happens

Upvotes: 1

Views: 944

Answers (3)

Sushant Sudarshan
Sushant Sudarshan

Reputation: 410

I faced the same issue with phantom-jasmine. In order to get this to work I relied on run_jasmine_test.coffee file from the phantom-jasmine repo. I copied this file (and the console-runner.js) in my repo and invoked the testRunner via phantomjs by running the following command in my terminal:

phantomjs lib/jasmine/run_jasmine_test.coffee testRunner.html

The output I got here was consistent with the output I got when I ran the testRunner.html directly in the browser.

Hope this helps.

Upvotes: 0

Jan Bentzen
Jan Bentzen

Reputation: 21

Not entirely sure why, but I got the examples running by omitting TestRunner.html from the call. Like this:

phantom-jasmine examples

It seems that the branch/version you get when installing using npm does not match what is described at https://github.com/jcarver989/phantom-jasmine.

Looking at the installed readme.md helped me.

Upvotes: 2

Rod
Rod

Reputation: 71

I had the same problem. In the meantime, I ended up switching to a new set of scripts to run jasmine tests with phantomjs from the command line. See SenchaProSvcs/UnitTestDemo.

Upvotes: 0

Related Questions