Add sol-cover implementation
This commit is contained in:
@@ -9,12 +9,11 @@ import { ContractName } from '../util/types';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { deployer } from './utils/deployer';
|
||||
import { web3, web3Wrapper } from './utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('EtherToken', () => {
|
||||
let account: string;
|
||||
|
@@ -22,12 +22,11 @@ import { OrderFactory } from '../../util/order_factory';
|
||||
import { BalancesByOwner, ContractName, ExchangeContractErrs } from '../../util/types';
|
||||
import { chaiSetup } from '../utils/chai_setup';
|
||||
import { deployer } from '../utils/deployer';
|
||||
import { web3, web3Wrapper } from '../utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('Exchange', () => {
|
||||
let maker: string;
|
||||
|
@@ -17,13 +17,12 @@ import { OrderFactory } from '../../util/order_factory';
|
||||
import { ContractName } from '../../util/types';
|
||||
import { chaiSetup } from '../utils/chai_setup';
|
||||
import { deployer } from '../utils/deployer';
|
||||
import { web3, web3Wrapper } from '../utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('Exchange', () => {
|
||||
let maker: string;
|
||||
|
@@ -22,12 +22,11 @@ import { OrderFactory } from '../../util/order_factory';
|
||||
import { BalancesByOwner, ContractName } from '../../util/types';
|
||||
import { chaiSetup } from '../utils/chai_setup';
|
||||
import { deployer } from '../utils/deployer';
|
||||
import { web3, web3Wrapper } from '../utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('Exchange', () => {
|
||||
let maker: string;
|
||||
|
8
packages/contracts/test/global_hooks.ts
Normal file
8
packages/contracts/test/global_hooks.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { getCoverageSubprovider } from '@0xproject/dev-utils';
|
||||
|
||||
after('generate coverage report', async () => {
|
||||
if (process.env.COVERAGE) {
|
||||
const coverageSubprovider = getCoverageSubprovider();
|
||||
await coverageSubprovider.writeCoverageAsync();
|
||||
}
|
||||
});
|
@@ -1,5 +1,5 @@
|
||||
import { LogWithDecodedArgs, ZeroEx } from '0x.js';
|
||||
import { BlockchainLifecycle, RPC, web3Factory } from '@0xproject/dev-utils';
|
||||
import { BlockchainLifecycle, web3Factory } from '@0xproject/dev-utils';
|
||||
import { AbiDecoder, BigNumber } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as chai from 'chai';
|
||||
@@ -15,14 +15,12 @@ import { ContractName, SubmissionContractEventArgs } from '../util/types';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { deployer } from './utils/deployer';
|
||||
import { web3, web3Wrapper } from './utils/web3_wrapper';
|
||||
|
||||
const MULTI_SIG_ABI = artifacts.MultiSigWalletWithTimeLockArtifact.networks[constants.TESTRPC_NETWORK_ID].abi;
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
const zeroEx = new ZeroEx(web3.currentProvider, { networkId: constants.TESTRPC_NETWORK_ID });
|
||||
const abiDecoder = new AbiDecoder([MULTI_SIG_ABI]);
|
||||
|
||||
@@ -39,11 +37,6 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
let multiSigWrapper: MultiSigWrapper;
|
||||
let txId: BigNumber;
|
||||
let initialSecondsTimeLocked: number;
|
||||
let rpc: RPC;
|
||||
|
||||
before(async () => {
|
||||
rpc = new RPC();
|
||||
});
|
||||
beforeEach(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
});
|
||||
@@ -192,7 +185,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
||||
});
|
||||
|
||||
it('should execute if it has enough confirmations and is past the time lock', async () => {
|
||||
await rpc.increaseTimeAsync(SECONDS_TIME_LOCKED.toNumber());
|
||||
await web3Wrapper.increaseTimeAsync(SECONDS_TIME_LOCKED.toNumber());
|
||||
await multiSig.executeTransaction.sendTransactionAsync(txId, { from: owners[0] });
|
||||
|
||||
const secondsTimeLocked = new BigNumber(await multiSig.secondsTimeLocked.callAsync());
|
||||
|
@@ -16,6 +16,7 @@ import { ContractName, SubmissionContractEventArgs, TransactionDataParams } from
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { deployer } from './utils/deployer';
|
||||
import { web3, web3Wrapper } from './utils/web3_wrapper';
|
||||
const PROXY_ABI = artifacts.TokenTransferProxyArtifact.networks[constants.TESTRPC_NETWORK_ID].abi;
|
||||
const MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI =
|
||||
artifacts.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddressArtifact.networks[constants.TESTRPC_NETWORK_ID]
|
||||
@@ -23,9 +24,7 @@ const MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI =
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
const abiDecoder = new AbiDecoder([MUTISIG_WALLET_WITH_TIME_LOCK_EXCEPT_REMOVE_AUTHORIZED_ADDRESS_ABI]);
|
||||
|
||||
describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => {
|
||||
|
@@ -14,12 +14,11 @@ import { ContractName } from '../util/types';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { deployer } from './utils/deployer';
|
||||
import { web3, web3Wrapper } from './utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('TokenRegistry', () => {
|
||||
let owner: string;
|
||||
|
@@ -8,12 +8,11 @@ import { constants } from '../../util/constants';
|
||||
import { ContractName } from '../../util/types';
|
||||
import { chaiSetup } from '../utils/chai_setup';
|
||||
import { deployer } from '../utils/deployer';
|
||||
import { web3, web3Wrapper } from '../utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('TokenTransferProxy', () => {
|
||||
let owner: string;
|
||||
|
@@ -11,12 +11,11 @@ import { constants } from '../../util/constants';
|
||||
import { ContractName } from '../../util/types';
|
||||
import { chaiSetup } from '../utils/chai_setup';
|
||||
import { deployer } from '../utils/deployer';
|
||||
import { web3, web3Wrapper } from '../utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('TokenTransferProxy', () => {
|
||||
let accounts: string[];
|
||||
|
@@ -17,12 +17,11 @@ import { OrderFactory } from '../../util/order_factory';
|
||||
import { BalancesByOwner, ContractName, ExchangeContractErrs } from '../../util/types';
|
||||
import { chaiSetup } from '../utils/chai_setup';
|
||||
import { deployer } from '../utils/deployer';
|
||||
import { web3, web3Wrapper } from '../utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('Arbitrage', () => {
|
||||
let coinbase: string;
|
||||
|
@@ -11,12 +11,11 @@ import { ContractName } from '../util/types';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { deployer } from './utils/deployer';
|
||||
import { web3, web3Wrapper } from './utils/web3_wrapper';
|
||||
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('UnlimitedAllowanceToken', () => {
|
||||
let owner: string;
|
||||
|
@@ -4,7 +4,10 @@ import * as path from 'path';
|
||||
|
||||
import { constants } from '../../util/constants';
|
||||
|
||||
import { web3 } from './web3_wrapper';
|
||||
|
||||
const deployerOpts = {
|
||||
web3Provider: web3.currentProvider,
|
||||
artifactsDir: path.resolve('src', 'artifacts'),
|
||||
jsonrpcPort: devConstants.RPC_PORT,
|
||||
networkId: constants.TESTRPC_NETWORK_ID,
|
||||
|
5
packages/contracts/test/utils/web3_wrapper.ts
Normal file
5
packages/contracts/test/utils/web3_wrapper.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { web3Factory } from '@0xproject/dev-utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
|
||||
export const web3 = web3Factory.create();
|
||||
export const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
@@ -11,12 +11,11 @@ import { ContractName } from '../util/types';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { deployer } from './utils/deployer';
|
||||
import { web3, web3Wrapper } from './utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const web3 = web3Factory.create();
|
||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||
const blockchainLifecycle = new BlockchainLifecycle();
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
|
||||
describe('ZRXToken', () => {
|
||||
let owner: string;
|
||||
|
Reference in New Issue
Block a user