diff --git a/packages/client/src/mock.ts b/packages/client/src/mock.ts index a752091b7..ba32b0d21 100644 --- a/packages/client/src/mock.ts +++ b/packages/client/src/mock.ts @@ -96,9 +96,9 @@ export const idToken = 'id_token_value'; export const currentUnixTimeStamp = Date.now() / 1000; -export const mockFetchOidcConfig: ( - delay?: number -) => Mock> = (delay = 0) => +export const mockFetchOidcConfig: (delay?: number) => Mock<() => Promise> = ( + delay = 0 +) => vi.fn(async () => { await new Promise((resolve) => { setTimeout(resolve, delay); @@ -112,10 +112,10 @@ export const mockFetchOidcConfig: ( revocationEndpoint, jwksUri, issuer, - }; + } satisfies OidcConfigResponse; }); -export const fetchOidcConfig: Mock> = mockFetchOidcConfig(); +export const fetchOidcConfig: Mock<() => Promise> = mockFetchOidcConfig(); export const requester = vi.fn(); export const failingRequester = vi.fn().mockRejectedValue(new Error('Failed request')); export const navigate = vi.fn(); diff --git a/packages/next-sample/next-env.d.ts b/packages/next-sample/next-env.d.ts index 4f11a03dc..a4a7b3f5c 100644 --- a/packages/next-sample/next-env.d.ts +++ b/packages/next-sample/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/packages/next-server-actions-sample/next-env.d.ts b/packages/next-server-actions-sample/next-env.d.ts index 4f11a03dc..40c3d6809 100644 --- a/packages/next-server-actions-sample/next-env.d.ts +++ b/packages/next-server-actions-sample/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/packages/sveltekit/src/__mocks__/@sveltejs/kit.ts b/packages/sveltekit/src/__mocks__/@sveltejs/kit.ts index 4fde0ef21..57ede9360 100644 --- a/packages/sveltekit/src/__mocks__/@sveltejs/kit.ts +++ b/packages/sveltekit/src/__mocks__/@sveltejs/kit.ts @@ -1,7 +1,4 @@ import { type redirect as originalRedirect } from '@sveltejs/kit'; import { type Mock, vi } from 'vitest'; -export const redirect: Mock< - Parameters, - ReturnType -> = vi.fn(); +export const redirect: Mock = vi.fn(); diff --git a/packages/vue/src/index.test.ts b/packages/vue/src/index.test.ts index c2292de9a..e38089630 100644 --- a/packages/vue/src/index.test.ts +++ b/packages/vue/src/index.test.ts @@ -14,7 +14,7 @@ const getAccessToken = vi.fn(() => { throw new Error('not authenticated'); }); const signIn = vi.fn(); -const injectMock = vi.fn((): unknown => { +const injectMock = vi.fn((key: string): unknown => { return undefined; }); vi.mock('vue', async (importOriginal) => {