You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very easy to write tests that will always pass if you incorrectly use toHaveReceivedCommand instead of toHaveReceivedCommandWith. It would be nice if toHaveReceivedCommand threw an error or warned you when you pass in a second parameter so you don't make that mistake.
This code will pass no matter what the second parameter is. It would be nice if it would save me from my own stupidity.
expect(schedulerMockClient).toHaveReceivedCommand(DeleteScheduleCommand, {
Name: 'I AM BAD'
})
It needs to be like this if you want it to actually fail.
expect(schedulerMockClient).toHaveReceivedCommandWith(DeleteScheduleCommand, {
Name: 'I AM BAD'
})
The text was updated successfully, but these errors were encountered:
…199)
* feat(jest): fail if more than expected matcher arguments are passed
Prevents accidental calling toHaveReceivedCommand(Cmd, {})
instead of toHaveReceivedCommandWith(Cmd, {})
Closes#191
It is very easy to write tests that will always pass if you incorrectly use
toHaveReceivedCommand
instead oftoHaveReceivedCommandWith
. It would be nice iftoHaveReceivedCommand
threw an error or warned you when you pass in a second parameter so you don't make that mistake.This code will pass no matter what the second parameter is. It would be nice if it would save me from my own stupidity.
It needs to be like this if you want it to actually fail.
The text was updated successfully, but these errors were encountered: