How to configure Istanbul to ignore methods in Node.js classes

61 Views Asked by At

I'm running nyc 15.1.0 with jasmine 4.6.0 to generate code coverage reports for specs for Node.js classes. How do I configure nyc to ignore all methods named "toString" in all classes? I tried adding "ignore-instance-method" and "ignore-class-method" to .nycrc but neither changes the generated report. (Adding a source comment with "istanbul ignore next" works, but I don't want to add it to every class). I know nyc is reading .nycrc because it picks up other configuration changes.

My .nycrc looks like this:

{
  "all": true,
  "ignore-class-method": ["toString"],
  ...
}

Thanks.

0

There are 0 best solutions below