chore(bidi): create parent dir for report.csv (#34294)

This commit is contained in:
Yury Semikhatsky 2025-01-10 13:43:43 -08:00 committed by GitHub
parent f0a3a15e93
commit 423005a7ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -66,7 +66,10 @@ class CsvReporter implements Reporter {
}
const csv = rows.map(r => r.join(',')).join('\n');
const reportFile = path.resolve(this._options.configDir, this._options.outputFile || 'test-results.csv');
this._pendingWrite = fs.promises.writeFile(reportFile, csv);
this._pendingWrite = (async () => {
await fs.mkdirSync(path.dirname(reportFile), { recursive: true });
await fs.promises.writeFile(reportFile, csv);
})();
}
async onExit() {