Monday, June 3, 2024
165
rated 0 times [  167] [ 2]  / answers: 1 / hits: 8399  / 11 Years ago, sun, february 9, 2014, 12:00:00

I added gem 'jasmine', '~> 2.0.0' in my Gemfile (group :development, :test) and ran the generator rails g jasmine:install.



I have one simple spec:



# spec/javascripts/truth_spec.js 
describe(Truth, function() {
it(herps the derps, function() {
expect(true).toEqual(true);
});
});


When I run rake jasmine I get presumably normal output:



your server is running here: http://localhost:8888/
your tests are here: /Users/jared/git/givegab/spec/javascripts
your source files are here: /Users/jared/git/givegab

>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:8888, CTRL+C to stop


I open http://localhost:8888/ in my browser and I get a blank grey screen. My JS console is empty, no errors, and when I trace execution using a debugger I can step through boot.js and jasmine.js. No errors are raised.



I can set a debugger breakpoint in truth_spec.js and it never gets hit.



This is my first time using jasmine, so please assume I am missing something obvious.


More From » ruby-on-rails

 Answers
16

My colleague has found the root problem. To our great embarrassment, we were overwriting window.onload. I can't think of any way jasmine (or S.O.) could have identified such a foolish mistake. Thanks for taking the time to help us troubleshoot this.



The gem author ragaskar helped us troubleshoot this, and gave us some good tips.


[#47924] Friday, February 7, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
annalise

Total Points: 210
Total Questions: 94
Total Answers: 102

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
annalise questions
Mon, May 24, 21, 00:00, 3 Years ago
Wed, May 5, 21, 00:00, 3 Years ago
Sat, Sep 12, 20, 00:00, 4 Years ago
Tue, Jul 28, 20, 00:00, 4 Years ago
;