Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress ignoreTestFiles is not ignoring tests

I'm trying to use ignoreTestFiles in cypress so that incomplete tests will not get run in the test suite.

The path to my tests is:

C:\Users\userA\IdeaProjects\automated_tests\cypress\integration\ignoredTestFiles

In cypress.json, I have the following entry:

"ignoreTestFiles": "*ignoredTestFiles*"

I used Globster to verify the minimatch, and it says its correct. But when I run my tests, these files are not getting ignored.

like image 516
TestRaptor Avatar asked Sep 10 '19 14:09

TestRaptor


People also ask

How do you ignore a cypress test?

skip in order to skip a test in a cypress suite.

Do Cypress tests run in order?

Cypress executes the support file before the spec file. For example, when Cypress executes a spec file via cypress open or cypress run , it executes the files in the following order: e2e example: support/e2e.

How do you run multiple tests on Cypress?

cypress run --spec <spec> Run tests specifying multiple test files to run.


2 Answers

You can also pass array like:

{
    "ignoreTestFiles": [
        "**/1-getting-started/*.js",
        "**/2-advanced-examples/*.js"
    ]
}
like image 95
Penny Liu Avatar answered Sep 22 '22 16:09

Penny Liu


You need to specify a match for files, so I suggest you to add *.js to your expression.

Also, you need to add another * to match any sub-directory structure, try this expression instead:

"ignoreTestFiles": "**/ignoredTestFiles/*.js"
like image 24
Diogo Rocha Avatar answered Sep 24 '22 16:09

Diogo Rocha