@@ -8,8 +8,8 @@ import { parseViewerData } from '../../src/pure/log-summary-parser';
88describe ( 'Evaluator log summary tests' , async function ( ) {
99 describe ( 'for a valid summary text' , async function ( ) {
1010 it ( 'should return only valid EvalLogData objects' , async function ( ) {
11- const validSummaryText = await fs . readFile ( path . join ( __dirname , 'evaluator-log-summaries/valid-summary.jsonl' ) , 'utf8 ') ;
12- const logDataItems = parseViewerData ( validSummaryText . toString ( ) ) ;
11+ const validSummaryPath = path . join ( __dirname , 'evaluator-log-summaries/valid-summary.jsonl' ) ;
12+ const logDataItems = await parseViewerData ( validSummaryPath ) ;
1313 expect ( logDataItems ) . to . not . be . undefined ;
1414 expect ( logDataItems . length ) . to . eq ( 3 ) ;
1515 for ( const item of logDataItems ) {
@@ -27,14 +27,14 @@ describe('Evaluator log summary tests', async function() {
2727 } ) ;
2828
2929 it ( 'should not parse a summary header object' , async function ( ) {
30- const invalidHeaderText = await fs . readFile ( path . join ( __dirname , 'evaluator-log-summaries/invalid-header.jsonl' ) , 'utf8 ') ;
31- const logDataItems = parseViewerData ( invalidHeaderText ) ;
30+ const invalidHeaderPath = path . join ( __dirname , 'evaluator-log-summaries/invalid-header.jsonl' ) ;
31+ const logDataItems = await parseViewerData ( invalidHeaderPath ) ;
3232 expect ( logDataItems . length ) . to . eq ( 0 ) ;
3333 } ) ;
3434
3535 it ( 'should not parse a log event missing RA or millis fields' , async function ( ) {
36- const invalidSummaryText = await fs . readFile ( path . join ( __dirname , 'evaluator-log-summaries/invalid-summary.jsonl' ) , 'utf8 ') ;
37- const logDataItems = parseViewerData ( invalidSummaryText ) ;
36+ const invalidSummaryPath = path . join ( __dirname , 'evaluator-log-summaries/invalid-summary.jsonl' ) ;
37+ const logDataItems = await parseViewerData ( invalidSummaryPath ) ;
3838 expect ( logDataItems . length ) . to . eq ( 0 ) ;
3939 } ) ;
4040 } ) ;
0 commit comments