@@ -194,14 +194,14 @@ describe("GeminiHandler", () => {
194194
195195 it ( "should handle only input tokens" , ( ) => {
196196 const inputTokens = 5000
197- // Added non-null assertion (!)
197+
198198 const expectedCost = ( inputTokens / 1_000_000 ) * mockInfo . inputPrice !
199199 expect ( handler . calculateCost ( { info : mockInfo , inputTokens, outputTokens : 0 } ) ) . toBeCloseTo ( expectedCost )
200200 } )
201201
202202 it ( "should handle only output tokens" , ( ) => {
203203 const outputTokens = 15000
204- // Added non-null assertion (!)
204+
205205 const expectedCost = ( outputTokens / 1_000_000 ) * mockInfo . outputPrice !
206206 expect ( handler . calculateCost ( { info : mockInfo , inputTokens : 0 , outputTokens } ) ) . toBeCloseTo ( expectedCost )
207207 } )
@@ -212,7 +212,6 @@ describe("GeminiHandler", () => {
212212 const cacheWriteTokens = 5000
213213 const CACHE_TTL = 5 // Match the constant in gemini.ts
214214
215- // Added non-null assertions (!)
216215 const expectedInputCost = ( inputTokens / 1_000_000 ) * mockInfo . inputPrice !
217216 const expectedOutputCost = ( outputTokens / 1_000_000 ) * mockInfo . outputPrice !
218217 const expectedCacheWriteCost =
@@ -229,7 +228,7 @@ describe("GeminiHandler", () => {
229228 const cacheReadTokens = 8000 // Part of inputTokens read from cache
230229
231230 const uncachedReadTokens = inputTokens - cacheReadTokens
232- // Added non-null assertions (!)
231+
233232 const expectedInputCost = ( uncachedReadTokens / 1_000_000 ) * mockInfo . inputPrice !
234233 const expectedOutputCost = ( outputTokens / 1_000_000 ) * mockInfo . outputPrice !
235234 const expectedCacheReadCost = mockInfo . cacheReadsPrice ! * ( cacheReadTokens / 1_000_000 )
0 commit comments