diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-09 22:45:45 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-12 10:37:28 +0800 |
commit | a9479b3c015961e93f396fb1e23dc61e261c6aef (patch) | |
tree | 7f63e7309be1afb673c437d8c534e10c0ff136e1 /packages/dev-utils/src/coverage.ts | |
parent | c5afca53a4e94b51956f10f564c2e9db00012c8f (diff) | |
download | dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.tar dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.tar.gz dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.tar.bz2 dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.tar.lz dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.tar.xz dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.tar.zst dexon-sol-tools-a9479b3c015961e93f396fb1e23dc61e261c6aef.zip |
Make coverage a module instead of a function
Diffstat (limited to 'packages/dev-utils/src/coverage.ts')
-rw-r--r-- | packages/dev-utils/src/coverage.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/dev-utils/src/coverage.ts b/packages/dev-utils/src/coverage.ts index b39fa5de4..db87e2285 100644 --- a/packages/dev-utils/src/coverage.ts +++ b/packages/dev-utils/src/coverage.ts @@ -3,12 +3,17 @@ import * as _ from 'lodash'; let coverageSubprovider: CoverageSubprovider; -export function getCoverageSubproviderSingleton(): CoverageSubprovider { - if (_.isUndefined(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; - coverageSubprovider = new CoverageSubprovider(artifactsPath, contractsPath, networkId); - } - return coverageSubprovider; -} + return new CoverageSubprovider(artifactsPath, contractsPath, networkId); + }, +}; |