Skip to content

Commit 7ace2db

Browse files
authored
Use function signature to support Vitest v4
1 parent decffc6 commit 7ace2db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stubs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const configureMock = <TMock extends Mock>(
3333
const behaviorStack = createBehaviorStack<TMock>()
3434
const fallbackImplementation = getFallbackImplementation(mock)
3535

36-
const implementation = (...args: ParametersOf<TMock>) => {
36+
function implementation(...args: ParametersOf<TMock>) {
3737
const behavior = behaviorStack.use(args)?.behavior ?? {
3838
type: BehaviorType.DO,
3939
callback: fallbackImplementation,
@@ -59,7 +59,7 @@ export const configureMock = <TMock extends Mock>(
5959

6060
case BehaviorType.DO: {
6161
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
62-
return behavior.callback?.(...args)
62+
return behavior.callback?.call(this, ...args)
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)