11import type { DailyUsage , SessionUsage } from './data-loader' ;
2- import { describe , expect , test } from 'bun:test' ;
32import {
43 calculateTotals ,
54 createTotalsObject ,
65 getTotalTokens ,
76} from './calculate-cost.ts' ;
87
9- describe ( 'Token aggregation utilities' , ( ) => {
10- test ( 'calculateTotals should aggregate daily usage data' , ( ) => {
8+ describe ( 'token aggregation utilities' , ( ) => {
9+ it ( 'calculateTotals should aggregate daily usage data' , ( ) => {
1110 const dailyData : DailyUsage [ ] = [
1211 {
1312 date : '2024-01-01' ,
@@ -39,7 +38,7 @@ describe('Token aggregation utilities', () => {
3938 expect ( totals . totalCost ) . toBeCloseTo ( 0.03 ) ;
4039 } ) ;
4140
42- test ( 'calculateTotals should aggregate session usage data' , ( ) => {
41+ it ( 'calculateTotals should aggregate session usage data' , ( ) => {
4342 const sessionData : SessionUsage [ ] = [
4443 {
4544 sessionId : 'session-1' ,
@@ -77,7 +76,7 @@ describe('Token aggregation utilities', () => {
7776 expect ( totals . totalCost ) . toBeCloseTo ( 0.03 ) ;
7877 } ) ;
7978
80- test ( 'getTotalTokens should sum all token types' , ( ) => {
79+ it ( 'getTotalTokens should sum all token types' , ( ) => {
8180 const tokens = {
8281 inputTokens : 100 ,
8382 outputTokens : 50 ,
@@ -89,7 +88,7 @@ describe('Token aggregation utilities', () => {
8988 expect ( total ) . toBe ( 185 ) ;
9089 } ) ;
9190
92- test ( 'getTotalTokens should handle zero values' , ( ) => {
91+ it ( 'getTotalTokens should handle zero values' , ( ) => {
9392 const tokens = {
9493 inputTokens : 0 ,
9594 outputTokens : 0 ,
@@ -101,7 +100,7 @@ describe('Token aggregation utilities', () => {
101100 expect ( total ) . toBe ( 0 ) ;
102101 } ) ;
103102
104- test ( 'createTotalsObject should create complete totals object' , ( ) => {
103+ it ( 'createTotalsObject should create complete totals object' , ( ) => {
105104 const totals = {
106105 inputTokens : 100 ,
107106 outputTokens : 50 ,
@@ -121,7 +120,7 @@ describe('Token aggregation utilities', () => {
121120 } ) ;
122121 } ) ;
123122
124- test ( 'calculateTotals should handle empty array' , ( ) => {
123+ it ( 'calculateTotals should handle empty array' , ( ) => {
125124 const totals = calculateTotals ( [ ] ) ;
126125 expect ( totals ) . toEqual ( {
127126 inputTokens : 0 ,
0 commit comments