Closed JackWCollins closed 8 years ago
Make sure you run as RAILS_ENV=test bundle exec rake spec:javascript
. Does that work?
I couldn't run it with RAILS_ENV=test
as the first argument so I put it after spec:javascript
, but besides that yes that is what I was running. I updated my original post to reflect what I was actually entering at the command line.
What version of phantomjs are you on?
I had the same issue after upgrading to phantomjs >2. I fixed it to 1.9.8 for now. Unfortunately I don't have time right now to check what exact version of phantomjs 2 introduces this problem.
Sorry for the late reply. I am currently on 2.0.0, but I was on 1.9.7 when I first saw this issue. However, for me, this was due to a spec error. Please see #156 for my issue description and 'fix'.
This can probably be closed @searls. I didn't realize it was still open - sorry about that.
If I run
bundle exec rake spec:javascript RAILS_ENV=test
from my command line, phantomJS will never exit if all of the tests pass. The last thing that is printed to the console is "ConsoleReporter finished" fromassets\javascripts\jasmine-console-reporter.js
. From the code comments, it looks like that was printed as a hook of some sort for PhantomJS to see and subsequently exit.However, I couldn't find any code that would actually cause PhantomJS to exit. I saw this piece of code in
assets\javascripts\jasmine-runner.js
that looks like it is waiting for a Phantom call:My workaround will be to add this piece of code in the
jasmine-console-reporter.js
. It seems to work. I will also make a pull request for this, unless you identify something I'm overlooking.