File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,14 +179,18 @@ describe("custom theme import helpers", () => {
179179 ) ;
180180
181181 expect ( imported . label ) . toBe ( "Light Green" ) ;
182- expect ( fetchImpl ) . toHaveBeenCalledWith (
183- "https://tweakcn.com/r/themes/cmlhfpjhw000004l4f4ax3m7z" ,
184- expect . objectContaining ( {
185- headers : { accept : "application/json" } ,
186- redirect : "error" ,
187- signal : expect . any ( AbortSignal ) ,
188- } ) ,
189- ) ;
182+ const fetchMock = vi . mocked ( fetchImpl ) ;
183+ expect ( fetchMock ) . toHaveBeenCalledTimes ( 1 ) ;
184+ const [ fetchUrl , fetchOptions ] = fetchMock . mock . calls [ 0 ] as [
185+ string ,
186+ { headers ?: unknown ; redirect ?: unknown ; signal ?: unknown } ,
187+ ] ;
188+ expect ( fetchUrl ) . toBe ( "https://tweakcn.com/r/themes/cmlhfpjhw000004l4f4ax3m7z" ) ;
189+ expect ( fetchOptions ) . toMatchObject ( {
190+ headers : { accept : "application/json" } ,
191+ redirect : "error" ,
192+ } ) ;
193+ expect ( fetchOptions . signal ) . toBeInstanceOf ( AbortSignal ) ;
190194 } ) ;
191195
192196 it ( "rejects oversized tweakcn theme responses before parsing" , async ( ) => {
You can’t perform that action at this time.
0 commit comments