-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e58aba
commit 984d11a
Showing
3 changed files
with
59 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,53 +29,81 @@ export default { | |
export const Expected = { | ||
args: { | ||
message: dedent` | ||
expect(jest.fn()).lastCalledWith(...expected) | ||
Expected: {"email": "[email protected]", "password": "testpasswordthatwontfail"} | ||
Number of calls: 0 | ||
expected last "spy" call to have been called with [ { …(2) } ] | ||
- Expected: | ||
Array [ | ||
Object { | ||
"email": "[email protected]", | ||
"password": "testpasswordthatwontfail", | ||
}, | ||
] | ||
+ Received: | ||
undefined | ||
`, | ||
}, | ||
}; | ||
|
||
export const ExpectedReceived = { | ||
args: { | ||
message: dedent` | ||
expect(jest.fn()).toHaveBeenCalledWith(...expected) | ||
Expected: called with 0 arguments | ||
Received: {"email": "[email protected]", "password": "testpasswordthatwontfail"} | ||
Number of calls: 1 | ||
expected last "spy" call to have been called with [] | ||
- Expected | ||
+ Received | ||
- Array [] | ||
+ Array [ | ||
+ Object { | ||
+ "email": "[email protected]", | ||
+ "password": "testpasswordthatwontfail", | ||
+ }, | ||
+ ] | ||
`, | ||
}, | ||
}; | ||
|
||
export const ExpectedNumberOfCalls = { | ||
args: { | ||
message: dedent` | ||
expect(jest.fn()).toHaveBeenCalledTimes(expected) | ||
Expected number of calls: 1 | ||
Received number of calls: 0 | ||
expected "spy" to not be called at all, but actually been called 1 times | ||
Received: | ||
1st spy call: | ||
Array [ | ||
Object { | ||
"email": "[email protected]", | ||
"password": "testpasswordthatwontfail", | ||
}, | ||
] | ||
Number of calls: 1 | ||
`, | ||
}, | ||
}; | ||
|
||
export const Diff = { | ||
args: { | ||
message: dedent` | ||
expect(jest.fn()).toHaveBeenCalledWith(...expected) | ||
- Expected | ||
+ Received | ||
Object { | ||
- "email": "[email protected]", | ||
+ "email": "[email protected]", | ||
"password": "testpasswordthatwontfail", | ||
}, | ||
expected "spy" to be called with arguments: [ { …(2) } ] | ||
Received: | ||
1st spy call: | ||
Array [ | ||
Object { | ||
- "email": "[email protected]", | ||
+ "email": "[email protected]", | ||
"password": "testpasswordthatwontfail", | ||
}, | ||
] | ||
Number of calls: 1 | ||
`, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters