diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-12 01:11:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-12 01:11:27 +0800 |
commit | 6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (patch) | |
tree | 8d374bf8f4f70a40d75c8bf4b35fe9a169250909 /packages/sol-cov/src | |
parent | f42f608f3f97a5244f09f17ae5ee184c0f775de3 (diff) | |
parent | ad8e12eeaebd40fdafac7cbef96121d4454909df (diff) | |
download | dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.gz dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.bz2 dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.lz dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.xz dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.tar.zst dexon-sol-tools-6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b.zip |
Merge pull request #579 from 0xProject/breakUp0xjs
Split 0x.js into: contract-wrappers & order-watcher
Diffstat (limited to 'packages/sol-cov/src')
-rw-r--r-- | packages/sol-cov/src/coverage_manager.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index f50f010b9..800ca96dd 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -1,7 +1,9 @@ +import { promisify } from '@0xproject/utils'; import { addHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import { Collector } from 'istanbul'; import * as _ from 'lodash'; +import * as mkdirp from 'mkdirp'; import * as path from 'path'; import { collectContractsData } from './collect_contract_data'; @@ -29,6 +31,8 @@ import { } from './types'; import { utils } from './utils'; +const mkdirpAsync = promisify<undefined>(mkdirp); + export class CoverageManager { private _sourcesPath: string; private _traceInfos: TraceInfo[] = []; @@ -49,6 +53,7 @@ export class CoverageManager { public async writeCoverageAsync(): Promise<void> { const finalCoverage = await this._computeCoverageAsync(); const stringifiedCoverage = JSON.stringify(finalCoverage, null, '\t'); + await mkdirpAsync('coverage'); fs.writeFileSync('coverage/coverage.json', stringifiedCoverage); } private _getSingleFileCoverageForTrace( |