Comments (17)
That's no good! I can't tell a ton from the stack trace. Could you share a minimal project that replicates the issue?
from jasmine-rails.
I also run into this problem when developing my project. When running `RAILS_ENV=test bundle exec rake spec:javascript' I run into
RAILS_ENV=test bundle exec rake spec:javascript
Running `"/usr/bin/phantomjs" "/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/home/colorvisa/workarea/working on/private-profile/tmp/jasmine/runner.html?spec="`
Running: /home/colorvisa/workarea/working on/private-profile/tmp/jasmine/runner.html?spec=
ERROR: ReferenceError: Can't find variable: jsApiReporter
TRACE:
-> phantomjs://webpage.evaluate(): 4
rake aborted!
Error executing command: "/usr/bin/phantomjs" "/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/home/colorvisa/workarea/working on/private-profile/tmp/jasmine/runner.html?spec="
/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/jasmine_rails/runner.rb:71:in `run_cmd'
/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/jasmine_rails/runner.rb:21:in `block in run'
/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/jasmine_rails/runner.rb:48:in `override_rails_config'
/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/jasmine_rails/runner.rb:9:in `run'
/home/colorvisa/.rvm/gems/ruby-2.1.1/gems/jasmine-rails-0.9.1/lib/tasks/jasmine-rails_tasks.rake:8:in `block (2 levels) in <top (required)>'
/home/colorvisa/.rvm/gems/ruby-2.1.1@global/bin/ruby_executable_hooks:15:in `eval'
/home/colorvisa/.rvm/gems/ruby-2.1.1@global/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => spec:javascript
(See full trace by running task with --trace)
However, when running in normal browser environment I do not get these errors localhost:3000/specs
.
from jasmine-rails.
I am experiencing the same problem — tests are fine in the browser, but when running the specs from the console, I get this error:
ERROR: ReferenceError: Can't find variable: jQuery
TRACE:
-> https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js: 5
I stripped down the runner.html file to the following, and still get an error when running it with "/home/acwatt/.phantomjs/1.9.7/x86_64-linux/bin/phantomjs" "/home/acwatt/.rvm/gems/ruby-2.1.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/home/acwatt/myproject/tmp/jasmine/runner.html?spec="
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
<title>Jasmine Specs</title>
<link href="./assets/jasmine.css" media="screen" rel="stylesheet" />
<link href="./assets/jasmine-specs.css" media="screen" rel="stylesheet" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
</head>
</html>
Any ideas? Thanks, and happy new year!
from jasmine-rails.
I'm having the same missing jsApiReporter variable issue. The specs pass but at the end the strange error shows up:
Running `"/usr/local/bin/phantomjs" "/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/home/runner/environet-ui/tmp/jasmine/runner.html?spec="`
Running: /home/runner/environet-ui/tmp/jasmine/runner.html?spec=
Starting...
Finished
-----------------
101 specs, 2 skipped or pending, 0 failures in 0.125s.
ConsoleReporter finished
ERROR: ReferenceError: Can't find variable: jsApiReporter
TRACE:
-> phantomjs://webpage.evaluate(): 4
ERROR: ReferenceError: Can't find variable: jsApiReporter
TRACE:
-> phantomjs://webpage.evaluate(): 4
......
... Lot of times
.......
ERROR: ReferenceError: Can't find variable: jsApiReporter
TRACE:
-> phantomjs://webpage.evaluate(): 4
rake aborted!
Error executing command: "/usr/local/bin/phantomjs" "/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/home/runner/environet-ui/tmp/jasmine/runner.html?spec="
/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/runner.rb:71:in `run_cmd'
/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/runner.rb:21:in `block in run'
/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/runner.rb:48:in `override_rails_config'
/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/jasmine_rails/runner.rb:9:in `run'
/home/runner/environet-ui/vendor/bundle/ruby/2.2.0/gems/jasmine-rails-0.10.5/lib/tasks/jasmine-rails_tasks.rake:8:in `block (2 levels) in <top (required)>'
Tasks: TOP => spec:javascript
(See full trace by running task with --trace)
How is it possible that a global jasmine reference like jsApiReporter is missing?
from jasmine-rails.
@fifigyuri, I had this issue using jasmine 2+, when adding blanket.js. the issue is that jasmine has changed and jasmine is not really global anymore. If you look at this diff getaroom/jasmine-rails@searls:master...master
It might assist you in either finding or resolving the issue. I apologize that I can't be more help at the moment.
** Disclaimer **
Also, I can't guarantee that my fork will work for you... I have made a lot of one off changes to support requirejs and blanket.
from jasmine-rails.
Thank you @AntiFish03, I tried to go through it, there's certainly lot of things to learn from the code you gave.
from jasmine-rails.
@fifigyuri I wish I could give you more but all I remember is that I ran into this issue and was able to fix it, so the problem has a solution.
from jasmine-rails.
actually the problem showed up to be with phantomjs
, we use now 1.9.7, version 1.9.8 has bugs, and the fixes are only on phantomjs master, no release before 2.0 is supposed to happen.
from jasmine-rails.
We were able to work around our Can't find variable: jsApiReporter
errors by following @fifigyuri and @jamesottaway's lead, and adding an explicit PhantomJS dependency to our Rails project:
# Gemfile
gem 'phantomjs', '< 1.9.8', '>= 1.9'
Which, in turn, installed:
# Gemfile.lock
phantomjs (1.9.7.1)
Hope that's useful!
from jasmine-rails.
👍
from jasmine-rails.
So I'm a bit in the dark as to what's happening here. Is this an error that only affects people running PhantomJS 2.x and Require.js?
from jasmine-rails.
@searls I'm running phantomjs 1.9.8.0 and jasmine-rails 0.11.0, no require.js, and seeing it. Tried directly requiring phantomjs as @toddmazierski suggested, but that didn't fix it.
from jasmine-rails.
@cherimarie or @toddmazierski, Are you using Jasmine 1.x or 2.x? I ask because Jasmine changed the boot file for 2.0+
https://github.com/jasmine/jasmine/blob/master/lib/jasmine-core/boot.js
And @searls I am just trying to help here... Least I can do since you gave me a great starting point to work from for what I needed.
from jasmine-rails.
@AntiFish03, here's more from our Gemfile.lock
:
jasmine-core (2.3.4)
jasmine-rails (0.10.8)
jasmine-core (>= 1.3, < 3.0)
phantomjs (>= 1.9)
railties (>= 3.2.0)
sprockets-rails
Hope this is useful!
from jasmine-rails.
ok so Jasmine 2.3.4 (latest release) When I get home from work I will try a clean project. I think it has to do with the Jasmine Boot (https://github.com/searls/jasmine-rails/blob/v0.10.8/lib/assets/javascripts/jasmine-boot.js) given that it is drastically different from what Jasmine-Core recommends (https://github.com/jasmine/jasmine/blob/master/lib/jasmine-core/boot.js)
from jasmine-rails.
jasmine-core (2.3.4)
jasmine-jquery-rails (2.0.3)
jasmine-rails (0.11.0)
jasmine-core (>= 1.3, < 3.0)
phantomjs (>= 1.9)
railties (>= 3.2.0)
sprockets-rails
from jasmine-rails.
@cherimarie @toddmazierski, I can't replicate this with a new project can you give me an example of a spec and JS that is causing this? It looks like the ConsoleReporter is running given
Finished
-----------------
101 specs, 2 skipped or pending, 0 failures in 0.125s.
ConsoleReporter finished
ERROR: ReferenceError: Can't find variable: jsApiReporter
So I wonder if some of your JS is still executing after the test suites finish...
from jasmine-rails.
Related Issues (20)
- Add Rails 5 to the build matrix
- "PhantomJS has crashed" problem when upgrade to PhantomJS 2.1.1 HOT 18
- "phantom_options: --debug=true" fails with "Invalid values for 'debug' option." HOT 3
- How to make jasmine-rails find jasmine HOT 1
- Error when running tests HOT 2
- `rake spec:javascript` shouldn't short circuit a chain of rake commands
- $templateCache not being hit HOT 1
- Using angular 1.3.2 will break jasmine specs HOT 1
- Empty spec causes infinite loop hang HOT 1
- Trouble with running tests in terminal HOT 5
- Error executing command HOT 2
- Out of date monkey patch on `compute_asset_path` breaks minitest on Rails 5.0.1+
- Running rake spec:javascript from terminal does not find specs HOT 3
- Suggest that users run with RAILS_ENV=test HOT 2
- SPEC= not working
- commandline skips all specs HOT 6
- Sourcemap on /assets/jasmine-specs.js HOT 1
- Update comment in offline_asset_paths.rb for newer versions of Rails HOT 4
- Add support for jasmine-core 3.x.x? HOT 3
- PhantomJs has been archived - Replace it with Headless Chrome HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jasmine-rails.