diff options
Diffstat (limited to 'packages/metacoin/test/utils')
-rw-r--r-- | packages/metacoin/test/utils/config.ts | 7 | ||||
-rw-r--r-- | packages/metacoin/test/utils/coverage.ts | 8 | ||||
-rw-r--r-- | packages/metacoin/test/utils/deployer.ts | 5 | ||||
-rw-r--r-- | packages/metacoin/test/utils/web3_wrapper.ts | 8 |
4 files changed, 17 insertions, 11 deletions
diff --git a/packages/metacoin/test/utils/config.ts b/packages/metacoin/test/utils/config.ts new file mode 100644 index 000000000..1b78cce2e --- /dev/null +++ b/packages/metacoin/test/utils/config.ts @@ -0,0 +1,7 @@ +export const config = { + networkId: 50, + artifactsDir: 'artifacts', + contractsDir: 'contracts', + ganacheLogFile: 'ganache.log', + mnemonic: 'concert load couple harbor equip island argue ramp clarify fence smart topic', +}; diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts index 5115dec0e..6b249384f 100644 --- a/packages/metacoin/test/utils/coverage.ts +++ b/packages/metacoin/test/utils/coverage.ts @@ -1,7 +1,8 @@ +import { devConstants } from '@0xproject/dev-utils'; import { CoverageSubprovider } from '@0xproject/sol-cov'; import * as _ from 'lodash'; -import { devConstants } from '@0xproject/dev-utils'; +import { config } from './config'; let coverageSubprovider: CoverageSubprovider; @@ -13,10 +14,7 @@ export const coverage = { return coverageSubprovider; }, _getCoverageSubprovider(): CoverageSubprovider { - const artifactsPath = 'artifacts'; - const contractsPath = 'contracts'; - const networkId = 50; const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - return new CoverageSubprovider(artifactsPath, contractsPath, networkId, defaultFromAddress); + return new CoverageSubprovider(config.artifactsDir, config.contractsDir, config.networkId, defaultFromAddress); }, }; diff --git a/packages/metacoin/test/utils/deployer.ts b/packages/metacoin/test/utils/deployer.ts index d7dbc6d36..7916c8541 100644 --- a/packages/metacoin/test/utils/deployer.ts +++ b/packages/metacoin/test/utils/deployer.ts @@ -2,12 +2,13 @@ import { Deployer } from '@0xproject/deployer'; import { devConstants } from '@0xproject/dev-utils'; import * as path from 'path'; +import { config } from './config'; import { web3Wrapper } from './web3_wrapper'; const deployerOpts = { web3Provider: web3Wrapper.getProvider(), - artifactsDir: path.resolve('artifacts'), - networkId: 50, + artifactsDir: config.artifactsDir, + networkId: config.networkId, defaults: { from: devConstants.TESTRPC_FIRST_ADDRESS, }, diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts index 216a1de5a..23bd62b93 100644 --- a/packages/metacoin/test/utils/web3_wrapper.ts +++ b/packages/metacoin/test/utils/web3_wrapper.ts @@ -5,6 +5,7 @@ import * as fs from 'fs'; import * as _ from 'lodash'; import ProviderEngine = require('web3-provider-engine'); +import { config } from './config'; import { coverage } from './coverage'; export const web3Provider = new ProviderEngine(); @@ -16,13 +17,12 @@ web3Provider.addProvider( new GanacheSubprovider({ logger: { log: (arg: any) => { - fs.appendFileSync('ganache.log', `${arg}\n`); + fs.appendFileSync(config.ganacheLogFile, `${arg}\n`); }, }, verbose: env.parseBoolean(EnvVars.SolidityCoverage), - port: 8545, - networkId: 50, - mnemonic: 'concert load couple harbor equip island argue ramp clarify fence smart topic', + networkId: config.networkId, + mnemonic: config.mnemonic, }), ); web3Provider.start(); |