TestRaptor
TestRaptor

Reputation: 1315

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.

Upvotes: 16

Views: 11467

Answers (3)

Michal Front
Michal Front

Reputation: 61

ignoreTestFiles has now been depracated, and replaced by excludeSpecPattern:

{
    //ignore built-in test files
    excludeSpecPattern: [
        "**/1-getting-started/.*.js",
        "**/2-advanced-examples/.*.js",
    ]
}

Upvotes: 6

Penny Liu
Penny Liu

Reputation: 17408

You can also pass array like:

{
    "ignoreTestFiles": [
        "**/1-getting-started/*.js",
        "**/2-advanced-examples/*.js"
    ]
}

Upvotes: 15

Diogo Rocha
Diogo Rocha

Reputation: 10575

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"

Upvotes: 29

Related Questions