Make istanbul reporter configurable

istanbul-reporter
Kanstantsin Andryanau 5 years ago committed by cgewecke
parent 3f59e8ae3b
commit 5b90a3e9d2
  1. 3
      README.md
  2. 7
      lib/app.js

@ -95,7 +95,8 @@ module.exports = {
| skipFiles | *Array* | `['Migrations.sol']` | Array of contracts or folders (with paths expressed relative to the `contracts` directory) that should be skipped when doing instrumentation. `Migrations.sol` is skipped by default, and does not need to be added to this configuration option if it is used. |
| deepSkip | boolean | false | Use this if instrumentation hangs on large, skipped files (like Oraclize). It's faster. |
| dir | *String* | `.` | Solidity-coverage copies all the assets in your root directory (except `node_modules`) to a special folder where it instruments the contracts and executes the tests. `dir` allows you to define a relative path from the root directory to those assets. Useful if your contracts & tests are within their own folder as part of a larger project.|
| buildDirPath | *String* | `/build/contracts` | Build directory path for compiled smart contracts
| buildDirPath | *String* | `/build/contracts` | Build directory path for compiled smart contracts |
| istanbulReporter | *Array* | ['html', 'lcov', 'text'] | Coverage reporters for Istanbul. Optional reporter replaces the default reporters. |
### FAQ

@ -42,6 +42,8 @@ class App {
this.gasLimit = 0xfffffffffff;
this.gasLimitString = "0xfffffffffff";
this.gasPrice = 0x01;
this.istanbulReporter = config.istanbulReporter || ['html', 'lcov', 'text'];
}
// -------------------------------------- Methods -----------------------------------------------
@ -122,9 +124,8 @@ class App {
this.saveCoverage(relativeMapping);
collector.add(relativeMapping);
reporter.add('html');
reporter.add('lcov');
reporter.add('text');
this.istanbulReporter.forEach(report => reporter.add(report));
reporter.write(collector, true, () => {
this.log('Istanbul coverage reports generated');

Loading…
Cancel
Save