Skip to content

Commit 0b0da8c

Browse files
authored
fix: component testing for windows
1 parent eab9148 commit 0b0da8c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/runner/browser-env/vite/plugins/generate-index-html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const plugin = async (): Promise<Plugin[]> => {
3838
const driverModulePath = path.resolve(browserModulesPath, "driver.js");
3939
const mockModulePath = path.resolve(browserModulesPath, "mock.js");
4040

41-
const automationProtocolPath = `/@fs${driverModulePath}`;
41+
const automationProtocolPath = path.posix.join("/@fs", driverModulePath.replaceAll(path.sep, path.posix.sep));
4242

4343
const stubDefaultModulePath = path.resolve(browserModulesPath, "stubs/default-module.js");
4444
const stubImportMetaResolvePath = path.resolve(browserModulesPath, "stubs/import-meta-resolve.js");

src/runner/browser-env/vite/utils.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ export const getTestInfoFromViteRequest = (req: Connect.IncomingMessage): TestIn
5454
);
5555
}
5656

57-
return { routeName, runUuid, env };
57+
return {
58+
routeName,
59+
runUuid,
60+
env: {
61+
...env,
62+
file: path.posix.join("/", path.relative(process.cwd(), env.file).replaceAll(path.sep, path.posix.sep)),
63+
},
64+
};
5865
};
5966

6067
export const getPathWithoutExtName = (fsPath: string): string => {

0 commit comments

Comments
 (0)