Skip to content

Commit e91179e

Browse files
fix(testing): change ignoreTestFiles to excludeSpecPattern for cy10+ (#13942)
1 parent 95a3bbf commit e91179e

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

docs/generated/packages/cypress/executors/cypress.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
"description": "A named group for recorded runs in the Cypress dashboard."
102102
},
103103
"ignoreTestFiles": {
104+
"aliases": ["excludeSpecPattern"],
104105
"type": "string",
105106
"description": "A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: `{dot: true, matchBase: true}`. We suggest using https://globster.xyz to test what files would match."
106107
},

packages/cypress/src/executors/cypress/cypress.impl.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ async function runCypress(
190190
baseUrl: string,
191191
opts: NormalizedCypressExecutorOptions
192192
) {
193+
const cypressVersion = installedCypressVersion();
193194
// Cypress expects the folder where a cypress config is present
194195
const projectFolderPath = dirname(opts.cypressConfig);
195196
const options: any = {
@@ -225,7 +226,15 @@ async function runCypress(
225226
options.parallel = opts.parallel;
226227
options.ciBuildId = opts.ciBuildId?.toString();
227228
options.group = opts.group;
228-
options.ignoreTestFiles = opts.ignoreTestFiles;
229+
// renamed in cy 10
230+
if (cypressVersion >= 10) {
231+
options.config ??= {};
232+
options.config[opts.testingType] = {
233+
excludeSpecPattern: opts.ignoreTestFiles,
234+
};
235+
} else {
236+
options.ignoreTestFiles = opts.ignoreTestFiles;
237+
}
229238

230239
if (opts.reporter) {
231240
options.reporter = opts.reporter;

packages/cypress/src/executors/cypress/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"description": "A named group for recorded runs in the Cypress dashboard."
109109
},
110110
"ignoreTestFiles": {
111+
"aliases": ["excludeSpecPattern"],
111112
"type": "string",
112113
"description": "A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: `{dot: true, matchBase: true}`. We suggest using https://globster.xyz to test what files would match."
113114
},

0 commit comments

Comments
 (0)