aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/src/coverage_subprovider.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-cov/src/coverage_subprovider.ts')
-rw-r--r--packages/sol-cov/src/coverage_subprovider.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts
index 174b7c6ac..1dcbfcbfe 100644
--- a/packages/sol-cov/src/coverage_subprovider.ts
+++ b/packages/sol-cov/src/coverage_subprovider.ts
@@ -3,6 +3,7 @@ import * as _ from 'lodash';
import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter';
import { CoverageManager } from './coverage_manager';
import { TraceCollectionSubprovider } from './trace_collection_subprovider';
+import { TraceInfo } from './types';
/**
* This class implements the [web3-provider-engine](https://github.com/MetaMask/provider-engine) subprovider interface.
@@ -25,12 +26,13 @@ export class CoverageSubprovider extends TraceCollectionSubprovider {
super(defaultFromAddress, traceCollectionSubproviderConfig);
this._coverageManager = new CoverageManager(artifactAdapter, isVerbose);
}
+ public async handleTraceInfoAsync(traceInfo: TraceInfo): Promise<void> {
+ return this._coverageManager.computeCoverageAsync(traceInfo);
+ }
/**
* Write the test coverage results to a file in Istanbul format.
*/
public async writeCoverageAsync(): Promise<void> {
- const traceInfos = this.getCollectedTraceInfos();
- _.forEach(traceInfos, traceInfo => this._coverageManager.appendTraceInfo(traceInfo));
- await this._coverageManager.writeCoverageAsync();
+ return this._coverageManager.writeCoverageAsync();
}
}