TypeError:jasmine.getEnv()。currentSpec为null [英] TypeError: jasmine.getEnv().currentSpec is null
本文介绍了TypeError:jasmine.getEnv()。currentSpec为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试运行我的jasmine规范时,我得到
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.
第498行是:
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.
那么,我从哪里开始?
(这是茉莉花rails 3.x项目中的gem)
(This is jasmine gem in a rails 3.x project)
推荐答案
我看到同样的错误。我在 describe
中直接有 expect
语句。我在 it
块中移动了 expect
,错误消失了。
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.
感谢 rinat-io 的想法。
这篇关于TypeError:jasmine.getEnv()。currentSpec为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文