Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't jasmine running any of my specs?

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.

like image 351
Jared Beck Avatar asked Oct 20 '22 14:10

Jared Beck


1 Answers

If jasmine is setup correctly, then opening http://localhost:8888/jasmine in your browser should run all of your specs.

You can also run specific specs with:

http://localhost:8888/jasmine?spec=herps the derps

like image 181
Jeff F. Avatar answered Oct 23 '22 04:10

Jeff F.