2
나는 다음과 자스민 사양을 가진 레일 응용 프로그램을 쓰고 있어요 후 beforeEach 전화 : 오류로 실패는 재스민 테스트
describe "buttons", ->
beforeEach ->
loadFixtures("foo.html")
alert("beforeEach: " + $("tr.foo").length)
describe ".hide_foo", ->
alert(".hide-foo: " + $("tr.foo").length)
...
expect($("tr.foo")).toBeHidden()
사양 :
TypeError: Cannot call method 'expect' of null
그래서 내가 경고에 넣어. 먼저 ".hide-foo : 0"을 확인한 다음 닫으면 "beforeEach : 44"가 표시됩니다. 우리가 을 불러 오기 전에 에러가 발생했는데 왜 ...
beforeEach
전에 각 예제가 실행되지 않았습니까?
Rails Asset Pipeline을 사용하여 Coffeescript를 컴파일하는 데 jasminerice를 사용하고 있습니다. 버전 :
$ bundle show jasmine && bundle show jasminerice
/home/tmacdonald/.rvm/gems/ruby-1.9.2-p320/gems/jasmine-1.2.0
/home/tmacdonald/.rvm/gems/ruby-1.9.2-p320/gems/jasminerice-0.0.9
고마워!
선량, 나는 더 많은 수면이 필요합니다. 고맙습니다. 나는 지금 나 자신을 보게 될 것이다. – tsm
하하, 내가 도울 수있어서 기뻤다 : P – loganfsmyth