Skip to content

Commit 27ea5fc

Browse files
committed
update
1 parent 0057775 commit 27ea5fc

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

npm/vite-dev-server/client/initCypressTests.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,9 @@ if (supportFile) {
3434

3535
// Using relative path wouldn't allow to load tests outside Vite project root folder
3636
// So we use the "@fs" bit to load the test file using its absolute path
37-
let testFileAbsolutePathRoute
38-
3937
// Normalize path to not include a leading slash (different on Win32 vs Unix)
40-
if (CypressInstance.config('platform') === 'win32') {
41-
testFileAbsolutePathRoute = `${devServerPublicPathRoute}/@fs/${CypressInstance.spec.absolute}`
42-
} else {
43-
testFileAbsolutePathRoute = `${devServerPublicPathRoute}/@fs${CypressInstance.spec.absolute}`
44-
}
38+
const normalizedAbsolutePath = CypressInstance.spec.absolute.replace(/^\//, '')
39+
const testFileAbsolutePathRoute = `${devServerPublicPathRoute}/@fs/${normalizedAbsolutePath}`
4540

4641
/* Spec file import logic */
4742
// We need a slash before /src/my-spec.js, this does not happen by default.

0 commit comments

Comments
 (0)