aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils/src/coverage.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/dev-utils/src/coverage.ts')
-rw-r--r--packages/dev-utils/src/coverage.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/dev-utils/src/coverage.ts b/packages/dev-utils/src/coverage.ts
new file mode 100644
index 000000000..40bb47e2d
--- /dev/null
+++ b/packages/dev-utils/src/coverage.ts
@@ -0,0 +1,22 @@
+import { CoverageSubprovider } from '@0xproject/sol-cov';
+import * as _ from 'lodash';
+
+import { constants } from './constants';
+
+let coverageSubprovider: CoverageSubprovider;
+
+export const coverage = {
+ getCoverageSubproviderSingleton(): CoverageSubprovider {
+ if (_.isUndefined(coverageSubprovider)) {
+ coverageSubprovider = coverage._getCoverageSubprovider();
+ }
+ return coverageSubprovider;
+ },
+ _getCoverageSubprovider(): CoverageSubprovider {
+ const artifactsPath = './src/artifacts';
+ const contractsPath = './src/contracts';
+ const networkId = 50;
+ const defaultFromAddress = constants.TESTRPC_FIRST_ADDRESS;
+ return new CoverageSubprovider(artifactsPath, contractsPath, networkId, defaultFromAddress);
+ },
+};