1
예외가 발생하지만, 시험에 의해 처리되지 가져옵니다 나타납니다
it "cannot be of size 0", ->
expect(new p.Goal("Goal 3", 0)).toThrow "Goal must be larger than 0 size"
:
cannot be of size 0
Failures:
1) cannot be of size 0
Message:
Error: Goal must be larger than 0 size
Stacktrace:
Error: Goal must be larger than 0 size
at new Goal (/var/lib/stickshift/1d4f33cd01e442eaa154aed2e7697ca7/app-root/data/235917/prioritization/process.coffee:14:15)
아이디어가 있으십니까?
가능한 [오류가 발생할 것으로 예상되는 테스트를 작성하는 방법] (http://stackoverflow.com/questions/4144686/how-to-write-a-test-which-expects-an-error) -to-be-throw) –
어쩌면 그렇게 생각 했으므로 익명 함수로 "p.Goal ("Goal 3 ", 0)을 호출하려고했습니다. expect (f = do -> new p.Goal ("Goal 3", 0)). 그러나 그 중 하나가 작동하지 않았습니다. –
이 구문이 효과가 있음이 밝혀졌습니다. expect (-> new p.Goal ("Goal 3", 0)). 0보다 커야합니다 " –