Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Running rake spec:javascript from terminal does not find specs #220

Open
momolog opened this issue Sep 15, 2017 · 3 comments
Open

Running rake spec:javascript from terminal does not find specs #220

momolog opened this issue Sep 15, 2017 · 3 comments

Comments

@momolog
Copy link

momolog commented Sep 15, 2017

When we go to /specs on our local server, we get

1 spec, 0 failures

but when we run RAILS_ENV=test bundle exec rake spec:javascript, it looks like there are no specs:

Running `"/usr/local/bin/phantomjs"  "/Users/aljoscha/.rvm/gems/ruby-2.2.2/gems/jasmine-rails-0.14.2/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "file:///Users/aljoscha/rails/jovoto/tmp/jasmine/runner.html?spec="`
Running: file:///Users/aljoscha/rails/jovoto/tmp/jasmine/runner.html?spec=
Starting...

Finished
-----------------
0 specs, 0 failures in 0.004s.

ConsoleReporter finished

The weirdest part is, that opening the above mentioned file:///Users/aljoscha/rails/jovoto/tmp/jasmine/runner.html?spec= in a browser does run the spec successfully.

What could be the reason for this / how can we debug this?

@tjefferson08
Copy link

tjefferson08 commented Jun 4, 2018

I've seen this a few times in apps for work. In my experience, it's because there is unsupported ES6/ES2015 JS code in the tests (I'd check the app code too though)

I'd do a quick hunt/grep for fat arrow functions =>
Or template strings! Or const/let.

Etc.

EDIT: not sure why phantomjs chokes on the modern JS but that explains why running it e.g. Chrome works fine.

@searls
Copy link
Member

searls commented Jun 4, 2018

Yes, phantomjs is deprecated/archived at this point and will never get various modern ES features, so unless code is compiled down to ES5 or lower, it'll choke. Headless mode for Chrome (and hopefully other browsers) are the future.

@hunterae
Copy link

@tjefferson08 : this is exactly what was happening with me - es6 syntax issues. Thanks for the suggestion!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants