Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,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 |
| reporter | *Array* | `[]` | Coverage reporters for Istanbul

### FAQ

Expand Down
9 changes: 6 additions & 3 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class App {
this.testCommand = config.testCommand || null; // Optional test command
this.compileCommand = config.compileCommand || null; // Optional compile command
this.deepSkip = config.deepSkip || null; // Don't post-process skipped files
this.reporterOptions = config.reporter || ['html', 'lcov', 'text']; // Coverage reporters for Istanbul

this.setLoggingLevel(config.silent);
}
Expand Down Expand Up @@ -342,9 +343,11 @@ class App {
fs.writeFileSync('./coverage.json', json);

collector.add(relativeMapping);
reporter.add('html');
reporter.add('lcov');
reporter.add('text');

if (this.reporterOptions && this.reporterOptions.length) {
this.reporterOptions.forEach(report => reporter.add(report));
}

reporter.write(collector, true, () => {
this.log('Istanbul coverage reports generated');
this.cleanUp();
Expand Down