@nx/cypress 18.1.0 → 18.1.1
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/package.json +5 -5
- package/plugins/cypress-preset.js +9 -4
- package/src/generators/component-configuration/component-configuration.js +1 -0
- package/src/generators/component-configuration/files/__directory__/support/component-index.html +4 -1
- package/src/generators/component-configuration/schema.d.ts +1 -0
- package/src/generators/configuration/configuration.js +2 -2
- package/src/utils/config.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.",
|
|
6
6
|
"repository": {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"migrations": "./migrations.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "18.1.
|
|
38
|
-
"@nx/eslint": "18.1.
|
|
39
|
-
"@nx/js": "18.1.
|
|
37
|
+
"@nx/devkit": "18.1.1",
|
|
38
|
+
"@nx/eslint": "18.1.1",
|
|
39
|
+
"@nx/js": "18.1.1",
|
|
40
40
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
41
41
|
"detect-port": "^1.5.1",
|
|
42
42
|
"semver": "^7.5.3",
|
|
43
43
|
"tslib": "^2.3.0",
|
|
44
|
-
"@nrwl/cypress": "18.1.
|
|
44
|
+
"@nrwl/cypress": "18.1.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"cypress": ">= 3 < 14"
|
|
@@ -39,9 +39,14 @@ function startWebServer(webServerCommand) {
|
|
|
39
39
|
stdio: 'inherit',
|
|
40
40
|
});
|
|
41
41
|
return () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
if (process.platform === 'win32') {
|
|
43
|
+
serverProcess.kill();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// child.kill() does not work on linux
|
|
47
|
+
// process.kill will kill the whole process group on unix
|
|
48
|
+
process.kill(-serverProcess.pid, 'SIGKILL');
|
|
49
|
+
}
|
|
45
50
|
};
|
|
46
51
|
}
|
|
47
52
|
/**
|
|
@@ -113,7 +118,7 @@ function waitForServer(url, webServerConfig) {
|
|
|
113
118
|
return new Promise((resolve, reject) => {
|
|
114
119
|
let pollTimeout;
|
|
115
120
|
const { protocol } = new URL(url);
|
|
116
|
-
const timeoutDuration = webServerConfig?.timeout ??
|
|
121
|
+
const timeoutDuration = webServerConfig?.timeout ?? 60 * 1000;
|
|
117
122
|
const timeout = setTimeout(() => {
|
|
118
123
|
clearTimeout(pollTimeout);
|
|
119
124
|
reject(new Error(`Web server failed to start in ${timeoutDuration}ms. This can be configured in cypress.config.ts.`));
|
package/src/generators/component-configuration/files/__directory__/support/component-index.html
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
6
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
7
|
<title><%= project %> Components App</title>
|
|
8
|
-
|
|
8
|
+
<% if(framework === 'next') { %>
|
|
9
|
+
<!-- Used by Next.js to inject CSS. -->
|
|
10
|
+
<div id="__next_css__DO_NOT_USE__"></div>
|
|
11
|
+
<% } %>
|
|
9
12
|
</head>
|
|
10
13
|
<body>
|
|
11
14
|
<div data-cy-root></div>
|
|
@@ -72,13 +72,13 @@ Rename or remove the existing e2e target.`);
|
|
|
72
72
|
}
|
|
73
73
|
if (!options.baseUrl &&
|
|
74
74
|
!options.devServerTarget &&
|
|
75
|
-
!projectConfig
|
|
75
|
+
!projectConfig?.targets?.serve) {
|
|
76
76
|
throw new Error(`The project ${options.project} does not have a 'serve' target.
|
|
77
77
|
In this case you need to provide a devServerTarget,'<projectName>:<targetName>[:<configName>]', or a baseUrl option`);
|
|
78
78
|
}
|
|
79
79
|
options.directory ??= 'src';
|
|
80
80
|
const devServerTarget = options.devServerTarget ??
|
|
81
|
-
(projectConfig
|
|
81
|
+
(projectConfig?.targets?.serve ? `${options.project}:serve` : undefined);
|
|
82
82
|
if (!options.baseUrl && !devServerTarget) {
|
|
83
83
|
throw new Error('Either baseUrl or devServerTarget must be provided');
|
|
84
84
|
}
|
package/src/utils/config.js
CHANGED
|
@@ -105,7 +105,7 @@ async function addMountDefinition(cmpCommandFileContents) {
|
|
|
105
105
|
exports.addMountDefinition = addMountDefinition;
|
|
106
106
|
function getProjectCypressConfigPath(tree, projectRoot) {
|
|
107
107
|
const cypressConfigPaths = (0, devkit_1.glob)(tree, [
|
|
108
|
-
|
|
108
|
+
(0, devkit_1.joinPathFragments)(projectRoot, exports.CYPRESS_CONFIG_FILE_NAME_PATTERN),
|
|
109
109
|
]);
|
|
110
110
|
if (cypressConfigPaths.length === 0) {
|
|
111
111
|
throw new Error(`Could not find a cypress config file in ${projectRoot}.`);
|