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'
})
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.