Skip to content

Commit

Permalink
chore: fix access to wrong properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Mar 23, 2023
1 parent 87faa91 commit 328e9b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/expect/src/jest-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
def(['toHaveBeenLastCalledWith', 'lastCalledWith'], function (...args: any[]) {
const spy = getSpy(this)
const spyName = spy.getMockName()
const lastCall = spy.mock.calls[spy.calls.length - 1]
const lastCall = spy.mock.calls[spy.mock.calls.length - 1]

this.assert(
jestEquals(lastCall, args, [iterableEquality]),
Expand Down Expand Up @@ -596,7 +596,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
def(['toHaveLastReturnedWith', 'lastReturnedWith'], function (value: any) {
const spy = getSpy(this)
const spyName = spy.getMockName()
const { value: lastResult } = spy.mock.results[spy.returns.length - 1]
const { value: lastResult } = spy.mock.results[spy.mock.results.length - 1]
const pass = jestEquals(lastResult, value)
this.assert(
pass,
Expand Down

0 comments on commit 328e9b9

Please sign in to comment.