Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Allow project specific coverage ignore paths #1635

Closed
barlock opened this issue Feb 22, 2019 · 2 comments · Fixed by #1656
Closed

Allow project specific coverage ignore paths #1635

barlock opened this issue Feb 22, 2019 · 2 comments · Fixed by #1656
Assignees

Comments

@barlock
Copy link

barlock commented Feb 22, 2019

Expected Behavior

As a user of sol-coverage I should be able to specify paths that I want to ignore from coverage so that I don't have to test my node_modules to get full test coverage.

Current Behavior

Right now, it just covers everything. Being able to ignore things allows me to ensure I can only focus on the code I want to.

Possible Solution

Intake a list of ignore paths, don't add those paths to the istanbul collector.

Context

This is getting run in a CI system with istanbul checking coverage.

Your Environment

Package Version
@0x/sol-coverage "^2.0.3"
@0x/sol-trace "^2.0.4"
Network
NAME
@LogvinovLeon LogvinovLeon self-assigned this Feb 26, 2019
@LogvinovLeon
Copy link
Contributor

Two questions.

  1. Would you be satisfied with just the boolean flag ignoreNodeModules (true by default) or do you need smth more complex than that?
  2. If you do - would you prefer glob or regex?

@barlock
Copy link
Author

barlock commented Feb 27, 2019

I want something more complex. In my current use case, I'm actually having to copy ERC721 contracts into my project as they don't have a payable modifier on transfer. I don't want these covered either.

I have this currently hacked together in a project https://github.com/ConsenSys/web3studio-bootleg/pull/125/files#diff-234b5ebe98eaf702468d693d7031023eR27

☝️ It's implemented with globs because of simplicity, but I would prefer regex to match other ignore formats (nyc, Jest, git, etc).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants