diff options
-rw-r--r-- | contracts/core/test/global_hooks.ts | 7 | ||||
-rw-r--r-- | contracts/multisig/test/global_hooks.ts | 19 | ||||
-rw-r--r-- | contracts/test-utils/CHANGELOG.json | 1 | ||||
-rw-r--r-- | contracts/test-utils/src/web3_wrapper.ts | 1 |
4 files changed, 25 insertions, 3 deletions
diff --git a/contracts/core/test/global_hooks.ts b/contracts/core/test/global_hooks.ts index 847b8ea91..f8ace376a 100644 --- a/contracts/core/test/global_hooks.ts +++ b/contracts/core/test/global_hooks.ts @@ -1,7 +1,9 @@ import { env, EnvVars } from '@0x/dev-utils'; -import { coverage, profiler } from '@0x/contracts-test-utils'; - +import { coverage, profiler, provider } from '@0x/contracts-test-utils'; +before('start web3 provider', () => { + provider.start(); +}); after('generate coverage report', async () => { if (env.parseBoolean(EnvVars.SolidityCoverage)) { const coverageSubprovider = coverage.getCoverageSubproviderSingleton(); @@ -11,4 +13,5 @@ after('generate coverage report', async () => { const profilerSubprovider = profiler.getProfilerSubproviderSingleton(); await profilerSubprovider.writeProfilerOutputAsync(); } + provider.stop(); }); diff --git a/contracts/multisig/test/global_hooks.ts b/contracts/multisig/test/global_hooks.ts new file mode 100644 index 000000000..68eb4f8d5 --- /dev/null +++ b/contracts/multisig/test/global_hooks.ts @@ -0,0 +1,19 @@ +import { env, EnvVars } from '@0x/dev-utils'; + +import { coverage, profiler, provider } from '@0x/contracts-test-utils'; + +before('start web3 provider engine', () => { + provider.start(); +}); + +after('generate coverage report', async () => { + if (env.parseBoolean(EnvVars.SolidityCoverage)) { + const coverageSubprovider = coverage.getCoverageSubproviderSingleton(); + await coverageSubprovider.writeCoverageAsync(); + } + if (env.parseBoolean(EnvVars.SolidityProfiler)) { + const profilerSubprovider = profiler.getProfilerSubproviderSingleton(); + await profilerSubprovider.writeProfilerOutputAsync(); + } + provider.stop(); +}); diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json deleted file mode 100644 index fe51488c7..000000000 --- a/contracts/test-utils/CHANGELOG.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/contracts/test-utils/src/web3_wrapper.ts b/contracts/test-utils/src/web3_wrapper.ts index f7b1a732a..cb33476f3 100644 --- a/contracts/test-utils/src/web3_wrapper.ts +++ b/contracts/test-utils/src/web3_wrapper.ts @@ -48,6 +48,7 @@ const ganacheConfigs = { const providerConfigs = testProvider === ProviderType.Ganache ? ganacheConfigs : gethConfigs; export const provider: Web3ProviderEngine = web3Factory.getRpcProvider(providerConfigs); +provider.stop(); const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); const isProfilerEnabled = env.parseBoolean(EnvVars.SolidityProfiler); const isRevertTraceEnabled = env.parseBoolean(EnvVars.SolidityRevertTrace); |