File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ class ReportResult {
9595class WPTReport {
9696 constructor ( path ) {
9797 this . filename = `report-${ path . replaceAll ( '/' , '-' ) } .json` ;
98+ // Resolve at construction time so cwd changes (e.g. tmpdir cleanup) don't affect the output path.
99+ this . filepath = require ( 'path' ) . resolve ( 'out' , 'wpt' , this . filename ) ;
98100 /** @type {Map<string, ReportResult> } */
99101 this . results = new Map ( ) ;
100102 this . time_start = Date . now ( ) ;
@@ -139,7 +141,7 @@ class WPTReport {
139141 os : getOs ( ) ,
140142 } ;
141143
142- fs . writeFileSync ( `out/wpt/ ${ this . filename } ` , JSON . stringify ( {
144+ fs . writeFileSync ( this . filepath , JSON . stringify ( {
143145 time_start : this . time_start ,
144146 time_end : this . time_end ,
145147 run_info : this . run_info ,
You can’t perform that action at this time.
0 commit comments