mirror of
https://github.com/vitest-dev/vitest.git
synced 2026-02-01 17:36:51 +00:00
fix: when toHaveBeenCalledWith/toBeCalledWith (#177)
Co-authored-by: Jose Cabrera <jose@codium.team>
This commit is contained in:
parent
d634f76bee
commit
d6b44b3ed3
@ -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) => {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user