@@ -51,47 +51,51 @@ if (import.meta.vitest != null) {
5151 it ( 'calculates cost for Claude model tokens' , async ( ) => {
5252 using fetcher = new PricingFetcher ( true ) ;
5353 const pricing = await Result . unwrap ( fetcher . getModelPricing ( 'claude-sonnet-4-20250514' ) ) ;
54+ expect ( pricing ) . not . toBeNull ( ) ;
5455 const cost = fetcher . calculateCostFromPricing ( {
5556 input_tokens : 1000 ,
5657 output_tokens : 500 ,
5758 cache_read_input_tokens : 300 ,
58- } , pricing ) ;
59+ } , pricing ! ) ;
5960
6061 expect ( cost ) . toBeGreaterThan ( 0 ) ;
6162 } ) ;
6263
6364 it ( 'calculates cost for GLM-4.5 model tokens' , async ( ) => {
6465 using fetcher = new PricingFetcher ( true ) ;
6566 const pricing = await Result . unwrap ( fetcher . getModelPricing ( 'glm-4.5' ) ) ;
67+ expect ( pricing ) . not . toBeNull ( ) ;
6668 const cost = fetcher . calculateCostFromPricing ( {
6769 input_tokens : 1000 ,
6870 output_tokens : 500 ,
6971 cache_read_input_tokens : 300 ,
70- } , pricing ) ;
72+ } , pricing ! ) ;
7173
7274 expect ( cost ) . toBeGreaterThan ( 0 ) ;
7375 } ) ;
7476
7577 it ( 'calculates cost for GLM-4.5 model with provider prefix' , async ( ) => {
7678 using fetcher = new PricingFetcher ( true ) ;
7779 const pricing = await Result . unwrap ( fetcher . getModelPricing ( 'deepinfra/zai-org/GLM-4.5' ) ) ;
80+ expect ( pricing ) . not . toBeNull ( ) ;
7881 const cost = fetcher . calculateCostFromPricing ( {
7982 input_tokens : 1000 ,
8083 output_tokens : 500 ,
8184 cache_read_input_tokens : 300 ,
82- } , pricing ) ;
85+ } , pricing ! ) ;
8386
8487 expect ( cost ) . toBeGreaterThan ( 0 ) ;
8588 } ) ;
8689
8790 it ( 'calculates cost for GLM-4.5-Air model' , async ( ) => {
8891 using fetcher = new PricingFetcher ( true ) ;
8992 const pricing = await Result . unwrap ( fetcher . getModelPricing ( 'glm-4.5-air' ) ) ;
93+ expect ( pricing ) . not . toBeNull ( ) ;
9094 const cost = fetcher . calculateCostFromPricing ( {
9195 input_tokens : 1000 ,
9296 output_tokens : 500 ,
9397 cache_read_input_tokens : 300 ,
94- } , pricing ) ;
98+ } , pricing ! ) ;
9599
96100 expect ( cost ) . toBeGreaterThan ( 0 ) ;
97101 } ) ;
0 commit comments