@cypress/vite-dev-server 7.0.1 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/initCypressTests.js +37 -14
- package/package.json +3 -4
|
@@ -47,20 +47,43 @@ if (supportFile) {
|
|
|
47
47
|
})
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
const specPath = new URLSearchParams(document.location.search).get('specPath')
|
|
51
|
+
|
|
52
|
+
// if the specPath is __all, then experimentalRunAllSpecs is set to true.
|
|
53
|
+
if (specPath === '__all' || CypressInstance.spec.relative === '__all') {
|
|
54
|
+
const runAllSpecs = window.parent.__RUN_ALL_SPECS__ || []
|
|
55
|
+
const allSpecs = window.parent.__RUN_MODE_SPECS__ || []
|
|
56
|
+
|
|
57
|
+
runAllSpecs.forEach((specRelative) => {
|
|
58
|
+
const specObj = allSpecs.find((s) => s.relative === specRelative)
|
|
59
|
+
|
|
60
|
+
if (specObj) {
|
|
61
|
+
const normalizedPath = specObj.absolute.replace(/^\//, '')
|
|
62
|
+
const specRoute = `${devServerPublicPathBase}/@fs/${normalizedPath}`
|
|
63
|
+
|
|
64
|
+
importsToLoad.push({
|
|
65
|
+
load: () => import(specRoute),
|
|
66
|
+
absolute: specObj.absolute,
|
|
67
|
+
relative: specObj.relative,
|
|
68
|
+
relativeUrl: specRoute,
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
} else {
|
|
73
|
+
// Using relative path wouldn't allow to load tests outside Vite project root folder
|
|
74
|
+
// So we use the "@fs" bit to load the test file using its absolute path
|
|
75
|
+
// Normalize path to not include a leading slash (different on Win32 vs Unix)
|
|
76
|
+
const normalizedAbsolutePath = CypressInstance.spec.absolute.replace(/^\//, '')
|
|
77
|
+
const testFileAbsolutePathRoute = `${devServerPublicPathBase}/@fs/${normalizedAbsolutePath}`
|
|
78
|
+
|
|
79
|
+
// We need a slash before /src/my-spec.js, this does not happen by default.
|
|
80
|
+
importsToLoad.push({
|
|
81
|
+
load: () => import(testFileAbsolutePathRoute),
|
|
82
|
+
absolute: CypressInstance.spec.absolute,
|
|
83
|
+
relative: CypressInstance.spec.relative,
|
|
84
|
+
relativeUrl: testFileAbsolutePathRoute,
|
|
85
|
+
})
|
|
86
|
+
}
|
|
64
87
|
|
|
65
88
|
if (!CypressInstance) {
|
|
66
89
|
throw new Error('Tests cannot run without a reference to Cypress!')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/vite-dev-server",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Launches Vite Dev Server for Component Testing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
|
|
12
12
|
"lint": "eslint --ext .js,.ts,.json, .",
|
|
13
13
|
"test": "vitest run --no-file-parallelism",
|
|
14
|
-
"watch": "tsc -w"
|
|
14
|
+
"watch": "tsc -w --project tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"debug": "^4.3.4",
|
|
18
18
|
"find-up": "6.3.0",
|
|
19
19
|
"node-html-parser": "5.3.3",
|
|
20
|
-
"semver": "^7.7.
|
|
20
|
+
"semver": "^7.7.3"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"cross-env": "7.0.3",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"vite-5": "npm:vite@^5.4.20",
|
|
26
26
|
"vite-6": "npm:vite@^6.4.0",
|
|
27
27
|
"vite-7": "npm:vite@^7.1.5",
|
|
28
|
-
"vite-plugin-inspect": "0.8.4",
|
|
29
28
|
"vitest": "2.1.9"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|