Skip to content

HugoDF/jest-ignore-coverage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest Ignore Coverage

To see all the following in action, run yarn install (or npm install) followed by yarn test (or npx jest --coverage) to collect coverage.

Exclude file(s) from Jest coverage using configuration

See ./package.json testPathIgnorePatterns. It ignores the contents of src/testignore, which actually just contains a failing test in ./src/testignore/ignored-test.test.js.

See ./package.json collectCoverageFrom. It does not collect coverage from ./src/config-ignore-me.js.

Exclude file from Jest coverage at the file level

See ./src/comment-ignored.js. It uses the comment notation to ignore the file.

Exclude function or statement from Jest coverage

See [./src/snippet.js]. It showcases the istanbul ignore next and istanbul ignore [type] syntax (in this case istanbul ignore else).

About

Examples of how to ignore files/functions/statements for coverage

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy