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 27, 2022
1 parent 95a3bbf commit e91179e
Show file tree
Hide file tree
Showing 3 changed files with 12 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
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

1 comment on commit e91179e

@vercel
Copy link

@vercel vercel bot commented on e91179e Dec 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.