aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils/test
diff options
context:
space:
mode:
authorHsuan Lee <hsuan@cobinhood.com>2019-01-19 18:42:04 +0800
committerHsuan Lee <hsuan@cobinhood.com>2019-01-19 18:42:04 +0800
commit7ae38906926dc09bc10670c361af0d2bf0050426 (patch)
tree5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/dev-utils/test
parentb5fd3c72a08aaa6957917d74c333387a16edf66b (diff)
downloaddexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar
dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz
dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2
dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz
dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz
dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst
dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip
Update dependency packages
Diffstat (limited to 'packages/dev-utils/test')
-rw-r--r--packages/dev-utils/test/.npmignore5
-rw-r--r--packages/dev-utils/test/blockchain_lifecycle_test.ts26
-rw-r--r--packages/dev-utils/test/rpc_test.ts43
3 files changed, 0 insertions, 74 deletions
diff --git a/packages/dev-utils/test/.npmignore b/packages/dev-utils/test/.npmignore
deleted file mode 100644
index 87bc30436..000000000
--- a/packages/dev-utils/test/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.*
-yarn-error.log
-/src/
-/scripts/
-tsconfig.json
diff --git a/packages/dev-utils/test/blockchain_lifecycle_test.ts b/packages/dev-utils/test/blockchain_lifecycle_test.ts
deleted file mode 100644
index d7e54f0e8..000000000
--- a/packages/dev-utils/test/blockchain_lifecycle_test.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { Web3Wrapper } from '@0x/web3-wrapper';
-import * as chai from 'chai';
-import 'mocha';
-
-import { BlockchainLifecycle, web3Factory } from '../src';
-
-const expect = chai.expect;
-
-describe('BlockchainLifecycle tests', () => {
- const provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true });
- const web3Wrapper = new Web3Wrapper(provider);
- const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
- describe('#startAsync/revertAsync', () => {
- it('reverts changes in between', async () => {
- const blockNumberBefore = await web3Wrapper.getBlockNumberAsync();
- await blockchainLifecycle.startAsync();
- await web3Wrapper.mineBlockAsync();
- const blockNumberAfter = await web3Wrapper.getBlockNumberAsync();
- // tslint:disable-next-line:restrict-plus-operands
- expect(blockNumberAfter).to.be.equal(blockNumberBefore + 1);
- await blockchainLifecycle.revertAsync();
- const blockNumberAfterRevert = await web3Wrapper.getBlockNumberAsync();
- expect(blockNumberAfterRevert).to.be.equal(blockNumberBefore);
- });
- });
-});
diff --git a/packages/dev-utils/test/rpc_test.ts b/packages/dev-utils/test/rpc_test.ts
deleted file mode 100644
index f8cea4580..000000000
--- a/packages/dev-utils/test/rpc_test.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { Web3Wrapper } from '@0x/web3-wrapper';
-import * as chai from 'chai';
-import { BlockParamLiteral } from 'ethereum-types';
-import 'mocha';
-
-import { web3Factory } from '../src';
-
-const expect = chai.expect;
-
-describe('RPC tests', () => {
- const provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true });
- const web3Wrapper = new Web3Wrapper(provider);
- describe('#mineBlockAsync', () => {
- it('increases block number when called', async () => {
- const blockNumberBefore = await web3Wrapper.getBlockNumberAsync();
- await web3Wrapper.mineBlockAsync();
- const blockNumberAfter = await web3Wrapper.getBlockNumberAsync();
- // tslint:disable-next-line:restrict-plus-operands
- expect(blockNumberAfter).to.be.equal(blockNumberBefore + 1);
- });
- });
- describe('#increaseTimeAsync', () => {
- it('increases time when called', async () => {
- const TIME_DELTA = 1000;
- const blockTimestampBefore = await web3Wrapper.getBlockTimestampAsync(BlockParamLiteral.Latest);
- await web3Wrapper.increaseTimeAsync(TIME_DELTA);
- await web3Wrapper.mineBlockAsync();
- const blockTimestampAfter = await web3Wrapper.getBlockTimestampAsync(BlockParamLiteral.Latest);
- // tslint:disable-next-line:restrict-plus-operands
- expect(blockTimestampAfter).to.be.at.least(blockTimestampBefore + TIME_DELTA);
- });
- });
- describe('#takeSnapshotAsync/revertSnapshotAsync', () => {
- it('reverts changes in between', async () => {
- const blockNumberBefore = await web3Wrapper.getBlockNumberAsync();
- const snapshotId = await web3Wrapper.takeSnapshotAsync();
- await web3Wrapper.mineBlockAsync();
- await web3Wrapper.revertSnapshotAsync(snapshotId);
- const blockNumberAfter = await web3Wrapper.getBlockNumberAsync();
- expect(blockNumberAfter).to.be.equal(blockNumberBefore);
- });
- });
-});