Skip to content

Commit 5a35625

Browse files
committed
fix constructable test mocks
1 parent aa69bbb commit 5a35625

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

packages/cli/tests/app-bun-compat.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ function mockBuildStrategy(
1717
execute: vi.fn(),
1818
}),
1919
) {
20-
return vi
21-
.fn()
22-
.mockImplementation((options: object) => createInstance(options));
20+
return vi.fn().mockImplementation(function BuildStrategyMock(
21+
options: object,
22+
) {
23+
return createInstance(options);
24+
});
2325
}
2426

2527
describe("bun compatibility", () => {

packages/cli/tests/app-provider.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ afterEach(() => {
1010
});
1111

1212
function mockPreviewBuildStrategy() {
13-
return vi.fn().mockImplementation((options: object) => ({ options }));
13+
return vi.fn().mockImplementation(function PreviewBuildStrategyMock(
14+
options: object,
15+
) {
16+
return { options };
17+
});
1418
}
1519

1620
describe("preview app provider", () => {

packages/cli/tests/auth-ops.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function encodeJwt(claims: Record<string, unknown>): string {
1515
}
1616

1717
function mockFileTokenStorage(getTokens: ReturnType<typeof vi.fn>) {
18-
return vi.fn().mockImplementation(() => ({ getTokens }));
18+
return vi.fn().mockImplementation(function FileTokenStorageMock() {
19+
return { getTokens };
20+
});
1921
}
2022

2123
describe("readAuthState", () => {

0 commit comments

Comments
 (0)