Skip to content

Commit 5df92fa

Browse files
committed
fix for windows invalid report pathname
1 parent 8bf267f commit 5df92fa

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

@bellatrix/runner/bellatrix.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ if (parseInt(nodeVersion[0].replace()) < 20 || (parseInt(nodeVersion[0]) === 20
99

1010
import { fork } from 'child_process';
1111
import { existsSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
12-
import { join, dirname, isAbsolute } from 'path';
12+
import { join, dirname, isAbsolute, win32 } from 'path';
1313
import { pathToFileURL } from 'url';
14-
import { tmpdir } from 'os';
14+
import { tmpdir, platform } from 'os';
1515
import ts from 'typescript';
1616
import yargs from 'yargs/yargs';
1717
import { hideBin } from 'yargs/helpers';
@@ -138,10 +138,14 @@ if ((!reportDirectory || !reportName) && reporter !== 'console-only') {
138138
throw new Error(`Properties testReportDirectory and testReportName should be specified unless testReporter is 'console-only'.`);
139139
}
140140

141-
const reportPath = reporter !== 'console-only'
141+
let reportPath = reporter !== 'console-only'
142142
? isAbsolute(reportDirectory) ? reportDirectory : join(dirname(configFileURI.pathname), reportDirectory)
143143
: null;
144144

145+
if (platform() === 'win32') {
146+
reportPath = win32.normalize(reportPath);
147+
}
148+
145149
switch (config.frameworkSettings.testSettings.testFramework) {
146150
case 'vitest': {
147151
const { createVitest } = await import('vitest/node');

0 commit comments

Comments
 (0)