0
隨着耙茉莉花我所有的測試通過瀏覽器。爲什麼耙茉莉花通過,但耙茉莉花:ci失敗TypeError:undefined不是函數?
隨着耙茉莉,2種規格失敗:
TypeError: undefined is not a function (evaluating 'expect(player).not.toBePlaying(song)') in http://localhost:36091/__spec__/PlayerSpec.js (line 28)
我已經配置了我的spec/javascripts/support/jasmine.yml
文件,以便它具有
src_files:
- src/Player.js
- src/Song.js
spec_files:
- '**/*[sS]pec.js'
src_dir:
spec_dir: spec
src/Song.js
有:
function Song() {
...
爲什麼rake jasmine:ci
失敗的這兩個例子?
的第一個失敗的代碼是:
it("should be able to play a Song", function() {
player.play(song);
expect(player.currentlyPlayingSong).toEqual(song);
//demonstrates use of custom matcher
expect(player).toBePlaying(song); # <-- error here
});
Song.js
似乎被加載,因爲如果我刪除所有5例失敗。