-
Notifications
You must be signed in to change notification settings - Fork 154
Can't find variable jsApiReporter #47
Comments
That's no good! I can't tell a ton from the stack trace. Could you share a minimal project that replicates the issue? |
I also run into this problem when developing my project. When running `RAILS_ENV=test bundle exec rake spec:javascript' I run into
However, when running in normal browser environment I do not get these errors |
I am experiencing the same problem — tests are fine in the browser, but when running the specs from the console, I get this error:
I stripped down the runner.html file to the following, and still get an error when running it with
Any ideas? Thanks, and happy new year! |
I'm having the same missing jsApiReporter variable issue. The specs pass but at the end the strange error shows up:
How is it possible that a global jasmine reference like jsApiReporter is missing? |
@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 ** |
Thank you @AntiFish03, I tried to go through it, there's certainly lot of things to learn from the code you gave. |
@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. |
actually the problem showed up to be with |
See testdouble#47 for more info.
See testdouble#47 for more info.
See testdouble#47 for more info.
We were able to work around our # Gemfile
gem 'phantomjs', '< 1.9.8', '>= 1.9' Which, in turn, installed:
Hope that's useful! |
👍 |
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? |
@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. |
@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. |
@AntiFish03, here's more from our
Hope this is useful! |
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) |
|
@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
So I wonder if some of your JS is still executing after the test suites finish... |
I have installed the jasmine-rails gem, and installed phantomJS with homebrew (I'm running OSX 10.8.4) and my jasmine.yml was working fine with the plain jasmine gem. Now when I run
I get the following error:
$ phantomjs "/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/jasmine-rails-0.4.5/lib/tasks/runner.js" "file:///Users/user/workspace/bacon/spec/tmp/runner.html?spec=BFApp.Views.ActivityFeedTab"
'Running: file:///Users/user/workspace/bacon/spec/tmp/runner.html?spec=BFApp.Views.ActivityFeedTab
ERROR: ReferenceError: Can't find variable: jsApiReporter
TRACE:
-> phantomjs://webpage.evaluate(): 3
rake aborted!
Error executing command: phantomjs "/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/jasmine-rails-0.4.5/lib/tasks/runner.js" "file:///Users/user/workspace/bacon/spec/tmp/runner.html?spec=BFApp.Views.ActivityFeedTab"
/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/jasmine-rails-0.4.5/lib/tasks/jasmine-rails_tasks.rake:5:in
run_cmd' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/jasmine-rails-0.4.5/lib/tasks/jasmine-rails_tasks.rake:28:in
block (2 levels) in <top (required)>'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:246:in
call' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:246:in
block in execute'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:241:in
each' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:241:in
execute'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:184:in
block in invoke_with_call_chain' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:177:in
invoke_with_call_chain'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/task.rb:170:in
invoke' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:143:in
invoke_task'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:101:in
block (2 levels) in top_level' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:101:in
each'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:101:in
block in top_level' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:110:in
run_with_threads'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:95:in
top_level' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:73:in
block in run'/Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:160:in
standard_exception_handling' /Users/user/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.0.4/lib/rake/application.rb:70:in
run'/Users/user/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in
eval' /Users/user/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in
The text was updated successfully, but these errors were encountered: