Output a diff if there was only one call, but with wrong parameters

This commit is contained in:
Maksym Kobieliev
2020-04-02 21:31:17 +03:00
parent e13fd13529
commit bcc28d7063
2 changed files with 17 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ describe("toHaveBeenCalledOnceWith", function () {
result = matcher.compare(calledSpy, 'a', 'b');
expect(result.pass).toBe(false);
expect(result.message).toEqual("Expected spy called-spy to have been called only once, and with given args:\n [ 'a', 'b' ]\nBut the actual calls were:\n [ 'a', 'c' ].\n\n");
expect(result.message).toEqual("Expected spy called-spy to have been called only once, and with given args:\n [ 'a', 'b' ]\nBut the actual call was:\n [ 'a', 'c' ].\nExpected $[1] = 'c' to equal 'b'.\n\n");
});
it("fails when the actual was called multiple times with expected parameters", function () {