@@ -2,6 +2,7 @@ import Maestro, { MaestroSocketMessage } from '../../src/providers/maestro';
22import MaestroOptions from '../../src/models/maestro_options' ;
33import TestingBotError from '../../src/models/testingbot_error' ;
44import fs from 'node:fs' ;
5+ import path from 'node:path' ;
56import axios from 'axios' ;
67import { Readable } from 'node:stream' ;
78import Credentials from '../../src/models/credentials' ;
@@ -980,7 +981,7 @@ describe('Maestro', () => {
980981 } ) ,
981982 ) ;
982983 expect ( fs . promises . writeFile ) . toHaveBeenCalledWith (
983- '/tmp/reports/ report_run_5678.xml' ,
984+ path . join ( '/tmp/reports' , ' report_run_5678.xml') ,
984985 mockReportXml ,
985986 'utf-8' ,
986987 ) ;
@@ -1021,7 +1022,7 @@ describe('Maestro', () => {
10211022 expect . any ( Object ) ,
10221023 ) ;
10231024 expect ( fs . promises . writeFile ) . toHaveBeenCalledWith (
1024- '/tmp/reports/ report_run_5678.html' ,
1025+ path . join ( '/tmp/reports' , ' report_run_5678.html') ,
10251026 mockReportHtml ,
10261027 'utf-8' ,
10271028 ) ;
@@ -1066,12 +1067,12 @@ describe('Maestro', () => {
10661067 expect ( axios . get ) . toHaveBeenCalledTimes ( 2 ) ;
10671068 expect ( fs . promises . writeFile ) . toHaveBeenCalledTimes ( 2 ) ;
10681069 expect ( fs . promises . writeFile ) . toHaveBeenCalledWith (
1069- '/tmp/reports/ report_run_5678.xml' ,
1070+ path . join ( '/tmp/reports' , ' report_run_5678.xml') ,
10701071 mockReportXml ,
10711072 'utf-8' ,
10721073 ) ;
10731074 expect ( fs . promises . writeFile ) . toHaveBeenCalledWith (
1074- '/tmp/reports/ report_run_9012.xml' ,
1075+ path . join ( '/tmp/reports' , ' report_run_9012.xml') ,
10751076 mockReportXml ,
10761077 'utf-8' ,
10771078 ) ;
@@ -1118,7 +1119,7 @@ describe('Maestro', () => {
11181119 // Only the second report should be written
11191120 expect ( fs . promises . writeFile ) . toHaveBeenCalledTimes ( 1 ) ;
11201121 expect ( fs . promises . writeFile ) . toHaveBeenCalledWith (
1121- '/tmp/reports/ report_run_9012.xml' ,
1122+ path . join ( '/tmp/reports' , ' report_run_9012.xml') ,
11221123 mockReportXml ,
11231124 'utf-8' ,
11241125 ) ;
@@ -1217,7 +1218,7 @@ describe('Maestro', () => {
12171218
12181219 expect ( result . success ) . toBe ( true ) ;
12191220 expect ( fs . promises . writeFile ) . toHaveBeenCalledWith (
1220- '/tmp/reports/ report_run_5678.xml' ,
1221+ path . join ( '/tmp/reports' , ' report_run_5678.xml') ,
12211222 mockReportXml ,
12221223 'utf-8' ,
12231224 ) ;
0 commit comments