fix: when toHaveBeenCalledWith/toBeCalledWith (#177)

Co-authored-by: Jose Cabrera <jose@codium.team>
This commit is contained in:
Jose Cabrera 2021-12-16 18:12:47 +01:00 committed by GitHub
parent d634f76bee
commit d6b44b3ed3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -208,6 +208,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
'expected spy to be called with arguments: #{exp}',
'expected spy to not be called with arguments: #{exp}',
args,
spy.calls,
)
})
const ordinalOf = (i: number) => {

View File

@ -27,6 +27,14 @@ describe('mock', () => {
expect(fn).toHaveBeenCalledWith('Hi', 1)
})
it('toHaveBeenCalledWith', () => {
const fn = vitest.fn()
fn('Hi', 2)
expect(fn).toHaveBeenCalledWith('Hi', 2)
})
it('returns', () => {
let i = 0