Old-style custom matchers (those which call this.report()) are not supported with the ".not" matcher negation syntax.
This commit is contained in:
@@ -513,6 +513,22 @@ describe("jasmine.Matchers", function() {
|
||||
match(false).not.custom();
|
||||
expect(lastResult().message).toEqual("Passed.");
|
||||
});
|
||||
|
||||
it("should make old-style custom matchers blow up, but only when negated", function() {
|
||||
spec.addMatchers({
|
||||
custom: function() {
|
||||
this.report();
|
||||
}
|
||||
});
|
||||
|
||||
expect(function() {
|
||||
match(true).custom();
|
||||
}).not.toThrow();
|
||||
|
||||
expect(function() {
|
||||
match(true).not.custom();
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe("spy matchers >>", function() {
|
||||
|
||||
Reference in New Issue
Block a user