0
항상 합격하도록 설계된 커플과 항상 실패하도록 설계된 커플을 만들었습니다. 여기 Jasmine Custom Matchers가 작동하지 않습니다.
내 사양 파일입니다
/* my-spec.js */
beforeEach(function() {
var matchers = {
toPass: function() {
return {
compare: function(actual) {
return {
pass: true
};
}
};
},
toFail: function() {
return {
compare: function(actual) {
return {
pass: false
};
}
};
}
};
this.addMatchers(matchers);
});
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect('this test').toPass();
expect('this test').toFail();
});
});
내가 jasmine-node tests
를 실행 (내 파일이 tests
폴더에), 나는 참조 : 내가 잘못
.
Finished in 0.018 seconds
1 test, 2 assertions, 0 failures, 0 skipped
을 뭐하는 거지?