Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: jasmine.getEnv().currentSpec is null

When I try to run my jasmine specs, I get

TypeError: jasmine.getEnv().currentSpec is null in 
    http://localhost:8888/__JASMINE_ROOT__/jasmine.js (line 498)

No idea why, not even sure where to begin looking.

Line 498 is:

return jasmine.getEnv().currentSpec.expect(actual);

I've been doing jasmine for several months now, but not on this project. I've never seen this happening before.

So, where do I start?

(This is jasmine gem in a rails 3.x project)

like image 924
Satya Avatar asked Jun 10 '12 17:06

Satya


1 Answers

I was seeing the same error. I had an expect statement directly inside describe. I moved the expect inside an it block an the error went away.

Thanks to rinat-io for the idea.

like image 75
isHristov Avatar answered Oct 27 '22 22:10

isHristov