Skip to content

Commit d32e882

Browse files
committed
test: ensure WPT report is in out/wpt
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
1 parent 43d5058 commit d32e882

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/common/wpt.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class ReportResult {
9595
class 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,

0 commit comments

Comments
 (0)