Shai M. Shai M. - 1 year ago 155
Node.js Question

Excluding files from coverage when using Mocha and Istanbul

How can I exclude folders and files (by path) from coverage report when using mocha and instanbul?

I want to exclude by a configuration and not

/*istanbul ignore next*/

in each file.

(The generated report use by Jenkins)


Answer Source

You can ignore files matching a certain pattern using the -x parameter.

 istanbul help cover

 -x <exclude-pattern> [-x <exclude-pattern>]
        one or more fileset patterns e.g. "**/vendor/**"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download