testdouble / jasmine-rails

A Jasmine runner for rails projects that's got you covered in both the terminal and the browser
http://rubygems.org/gems/jasmine-rails
MIT License
377 stars 154 forks source link

ERROR: TypeError: 'undefined' is not an object (evaluating 'parent.prototype') #115

Closed rbriank closed 9 years ago

rbriank commented 10 years ago

Specs all pass if I run a server and browse to /specs

When I run:

rake spec:javascript

I get:

Running `"/usr/local/bin/phantomjs" "/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/Users/brian.kierstead/dev/pam/tmp/jasmine/runner.html?spec="`
Running: /Users/brian.kierstead/dev/pam/tmp/jasmine/runner.html?spec=
ERROR: TypeError: 'undefined' is not an object (evaluating 'parent.prototype')
TRACE:
 -> file:///Users/brian.kierstead/dev/pam/tmp/jasmine/assets/pam/mpower.js: 3
 -> file:///Users/brian.kierstead/dev/pam/tmp/jasmine/assets/pam/mpower.js: 6
 -> file:///Users/brian.kierstead/dev/pam/tmp/jasmine/assets/pam/mpower.js: 25
 -> file:///Users/brian.kierstead/dev/pam/tmp/jasmine/assets/pam/mpower.js: 27
rake aborted!
Error executing command: "/usr/local/bin/phantomjs" "/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/Users/brian.kierstead/dev/pam/tmp/jasmine/runner.html?spec="
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/runner.rb:70:in `run_cmd'
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/runner.rb:21:in `block in run'
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/runner.rb:48:in `override_rails_config'
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/runner.rb:9:in `run'
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/tasks/jasmine-rails_tasks.rake:7:in `block (2 levels) in <top (required)>'
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/bin/ruby_executable_hooks:15:in `eval'
/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => spec:javascript

If I run:

$ RAILS_ENV=test rake spec:javascript

I get:

Running `"/usr/local/bin/phantomjs" "/Users/brian.kierstead/.rvm/gems/ruby-2.0.0-p353@pam/gems/jasmine-rails-0.6.0/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/Users/brian.kierstead/dev/pam/tmp/jasmine/runner.html?spec="`
Running: /Users/brian.kierstead/dev/pam/tmp/jasmine/runner.html?spec=
opening database pam-database in version #18
Notifier: skipping badges while offline.
Starting...
Persist for store values should store
  Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
    undefined

  Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
    undefined

  TypeError: 'undefined' is not an object (evaluating 'result.key') in file:///Users/brian.kierstead/dev/pam/tmp/jasmine/assets/jasmine-specs.js (line 90489)
    TypeError: 'undefined' is not an object (evaluating 'result.key')
    at file:///Users/brian.kierstead/dev/pam/tmp/jasmine/assets/jasmine-specs.js:90489
    at file:///Users/brian.kierstead/de
......
<snip>

In both cases, tmp/jasmine includes all the source files separately and not as a single application.js file. I'm not sure if that is the problem, but I was reading elsewhere that it could be.

searls commented 10 years ago

I tried and failed to reproduce this. Could you post an example project with this issue?

tojofo commented 9 years ago

@rbriank are you using backbone + marionette per chance?

rbriank commented 9 years ago

Only backbone. Haven't tried this for a while, so it may be working.

On Mon, Jan 5, 2015 at 8:01 PM, Tommy Fotak notifications@github.com wrote:

@rbriank https://github.com/rbriank are you using backbone + marionetter per chance?

— Reply to this email directly or view it on GitHub https://github.com/searls/jasmine-rails/issues/115#issuecomment-68810609 .

tojofo commented 9 years ago

In my case I had to update my Marionette Layout views to extend LayoutView and change itemView properties to childView properties.

searls commented 9 years ago

Closing unless this is still an issue. Probably caused by peculiarities of production code.