Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(testing): change ignoreTestFiles to excludeSpecPattern for cy10+ #13942

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
11 changes: 10 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,15 @@ 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 ??= {};
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