@@ -56,7 +56,7 @@ describe("OpenRouter usage", () => {
5656 } ) ;
5757
5858 it ( "keeps custom provider credentials on the configured usage origin" , async ( ) => {
59- const fetchFn = vi . fn ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
59+ const fetchFn = vi . fn < typeof fetch > ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
6060
6161 await fetchOpenRouterUsage ( {
6262 token : "synthetic-private-proxy-key" ,
@@ -77,7 +77,7 @@ describe("OpenRouter usage", () => {
7777 } ) ;
7878
7979 it ( "preserves configured request headers and custom auth for both proxy usage endpoints" , async ( ) => {
80- const fetchFn = vi . fn ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
80+ const fetchFn = vi . fn < typeof fetch > ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
8181
8282 await fetchOpenRouterUsage ( {
8383 token : "synthetic-original-key" ,
@@ -123,7 +123,7 @@ describe("OpenRouter usage", () => {
123123 } ) ;
124124
125125 it ( "preserves explicitly allowed private-origin usage requests" , async ( ) => {
126- const fetchFn = vi . fn ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
126+ const fetchFn = vi . fn < typeof fetch > ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
127127
128128 await fetchOpenRouterUsage ( {
129129 token : "synthetic-private-key" ,
@@ -140,7 +140,7 @@ describe("OpenRouter usage", () => {
140140 } ) ;
141141
142142 it ( "trusts only the operator-configured private origin when no deny policy is set" , async ( ) => {
143- const fetchFn = vi . fn ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
143+ const fetchFn = vi . fn < typeof fetch > ( async ( ) => Response . json ( { data : { usage : 1 } } ) ) ;
144144
145145 await fetchOpenRouterUsage ( {
146146 token : "synthetic-private-key" ,
@@ -234,7 +234,7 @@ describe("OpenRouter usage", () => {
234234 ) ;
235235
236236 it ( "surfaces blocked usage redirects without replaying private credentials" , async ( ) => {
237- const fetchFn = vi . fn (
237+ const fetchFn = vi . fn < typeof fetch > (
238238 async ( ) =>
239239 new Response ( null , {
240240 status : 302 ,
0 commit comments