We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43d5058 commit d32e882Copy full SHA for d32e882
1 file changed
test/common/wpt.js
@@ -95,6 +95,8 @@ class ReportResult {
95
class WPTReport {
96
constructor(path) {
97
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);
100
/** @type {Map<string, ReportResult>} */
101
this.results = new Map();
102
this.time_start = Date.now();
@@ -139,7 +141,7 @@ class WPTReport {
139
141
os: getOs(),
140
142
};
143
- fs.writeFileSync(`out/wpt/${this.filename}`, JSON.stringify({
144
+ fs.writeFileSync(this.filepath, JSON.stringify({
145
time_start: this.time_start,
146
time_end: this.time_end,
147
run_info: this.run_info,
0 commit comments