Luke Snowden
Luke Snowden

Reputation: 4196

Exclude files from Cypress.io Coverage Report

Hi Im using cypress coverage report but I have a class which houses all touch device specific functionality and as I'm running the tests on my Mac, they never run. Is there any way to exclude this class?

Upvotes: 4

Views: 4294

Answers (3)

Theo
Theo

Reputation: 2042

On cypress version 10, what worked for me is to create a .nycrc.json file which contains

{
  "exclude": [...],
}

Upvotes: 0

srkigres
srkigres

Reputation: 37

If this doesn't work:

"nyc": {
   "exclude": [...]
}

Then add one more property like this:

"nyc": {
   "exclude": [...],
   "excludeAfterRemap": true
}

Upvotes: 1

vandries
vandries

Reputation: 76

you might want to check cypress coverage readme:

...

"nyc": {
   "include": [...],
   "exclude": [...]
}

...

Upvotes: 4

Related Questions