File tree Expand file tree Collapse file tree 5 files changed +9
-12
lines changed
next-server-actions-sample
sveltekit/src/__mocks__/@sveltejs Expand file tree Collapse file tree 5 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,9 @@ export const idToken = 'id_token_value';
9696
9797export const currentUnixTimeStamp = Date . now ( ) / 1000 ;
9898
99- export const mockFetchOidcConfig : (
100- delay ?: number
101- ) => Mock < unknown [ ] , Promise < OidcConfigResponse > > = ( delay = 0 ) =>
99+ export const mockFetchOidcConfig : ( delay ?: number ) => Mock < ( ) => Promise < OidcConfigResponse > > = (
100+ delay = 0
101+ ) =>
102102 vi . fn ( async ( ) => {
103103 await new Promise ( ( resolve ) => {
104104 setTimeout ( resolve , delay ) ;
@@ -112,10 +112,10 @@ export const mockFetchOidcConfig: (
112112 revocationEndpoint,
113113 jwksUri,
114114 issuer,
115- } ;
115+ } satisfies OidcConfigResponse ;
116116 } ) ;
117117
118- export const fetchOidcConfig : Mock < unknown [ ] , Promise < OidcConfigResponse > > = mockFetchOidcConfig ( ) ;
118+ export const fetchOidcConfig : Mock < ( ) => Promise < OidcConfigResponse > > = mockFetchOidcConfig ( ) ;
119119export const requester = vi . fn ( ) ;
120120export const failingRequester = vi . fn ( ) . mockRejectedValue ( new Error ( 'Failed request' ) ) ;
121121export const navigate = vi . fn ( ) ;
Original file line number Diff line number Diff line change 22/// <reference types="next/image-types/global" />
33
44// NOTE: This file should not be edited
5- // see https://nextjs.org/docs/basic-features /typescript for more information.
5+ // see https://nextjs.org/docs/pages/building-your-application/configuring /typescript for more information.
Original file line number Diff line number Diff line change 22/// <reference types="next/image-types/global" />
33
44// NOTE: This file should not be edited
5- // see https://nextjs.org/docs/basic-features /typescript for more information.
5+ // see https://nextjs.org/docs/app/building-your-application/configuring /typescript for more information.
Original file line number Diff line number Diff line change 11import { type redirect as originalRedirect } from '@sveltejs/kit' ;
22import { type Mock , vi } from 'vitest' ;
33
4- export const redirect : Mock <
5- Parameters < typeof originalRedirect > ,
6- ReturnType < typeof originalRedirect >
7- > = vi . fn ( ) ;
4+ export const redirect : Mock < typeof originalRedirect > = vi . fn ( ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const getAccessToken = vi.fn(() => {
1414 throw new Error ( 'not authenticated' ) ;
1515} ) ;
1616const signIn = vi . fn ( ) ;
17- const injectMock = vi . fn < string [ ] , unknown > ( ( ) : unknown => {
17+ const injectMock = vi . fn ( ( key : string ) : unknown => {
1818 return undefined ;
1919} ) ;
2020vi . mock ( 'vue' , async ( importOriginal ) => {
You can’t perform that action at this time.
0 commit comments