Improve errors with the domaine and how to use the API

This commit is contained in:
dhoko
2016-01-20 15:49:47 +01:00
parent b6798cdb06
commit 14067d0785
16 changed files with 131 additions and 28 deletions

View File

@@ -24,7 +24,7 @@ describe("toHaveBeenCalledTimes", function() {
spy();
expect(function() {
matcher.compare(spy);
}).toThrowError('The expected times failed is a required argument and must be a number.');
}).toThrowError(/The expected times failed is a required argument and must be a number./);
});
it("fails when the actual was called less than the expected", function() {
@@ -54,7 +54,7 @@ describe("toHaveBeenCalledTimes", function() {
expect(function() {
matcher.compare(fn);
}).toThrowError("Expected a spy, but got Function.");
}).toThrowError(/Expected a spy, but got Function./);
});
it("has a custom message on failure that tells it was called only once", function() {