Skip to content

Commit

Permalink
fix(testing): change ignoreTestFiles to excludeSpecPattern for cy10+
Browse files Browse the repository at this point in the history
  • Loading branch information
barbados-clemens committed Dec 20, 2022
1 parent ae8e028 commit 0824b08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/generated/packages/cypress/executors/cypress.json
Expand Up @@ -101,6 +101,7 @@
"description": "A named group for recorded runs in the Cypress dashboard."
},
"ignoreTestFiles": {
"aliases": ["excludeSpecPattern"],
"type": "string",
"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."
},
Expand Down
10 changes: 9 additions & 1 deletion packages/cypress/src/executors/cypress/cypress.impl.ts
Expand Up @@ -190,6 +190,7 @@ async function runCypress(
baseUrl: string,
opts: NormalizedCypressExecutorOptions
) {
const cypressVersion = installedCypressVersion();
// Cypress expects the folder where a cypress config is present
const projectFolderPath = dirname(opts.cypressConfig);
const options: any = {
Expand Down Expand Up @@ -225,7 +226,14 @@ async function runCypress(
options.parallel = opts.parallel;
options.ciBuildId = opts.ciBuildId?.toString();
options.group = opts.group;
options.ignoreTestFiles = opts.ignoreTestFiles;
// renamed in cy 10
if (cypressVersion >= 10) {
options.config[opts.testingType] = {
excludeSpecPattern: opts.ignoreTestFiles,
};
} else {
options.ignoreTestFiles = opts.ignoreTestFiles;
}

if (opts.reporter) {
options.reporter = opts.reporter;
Expand Down
1 change: 1 addition & 0 deletions packages/cypress/src/executors/cypress/schema.json
Expand Up @@ -108,6 +108,7 @@
"description": "A named group for recorded runs in the Cypress dashboard."
},
"ignoreTestFiles": {
"aliases": ["excludeSpecPattern"],
"type": "string",
"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."
},
Expand Down

0 comments on commit 0824b08

Please sign in to comment.