aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2017-11-23 06:20:45 +0800
committerBrandon Millman <brandon.millman@gmail.com>2017-11-23 06:20:45 +0800
commitc0e17f613666ebe8fdae394694fd065eb4e418f0 (patch)
tree8d87abf28376622d812ae689919a00ff77648cf0 /packages/0x.js/test
parentb38142ddb18857d7d2cf36006a2ebcfd0b700cca (diff)
downloaddexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.tar
dexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.tar.gz
dexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.tar.bz2
dexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.tar.lz
dexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.tar.xz
dexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.tar.zst
dexon-sol-tools-c0e17f613666ebe8fdae394694fd065eb4e418f0.zip
Add blockchainLifecycle management to the ExpirationWatcher test
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r--packages/0x.js/test/expiration_watcher_test.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/0x.js/test/expiration_watcher_test.ts b/packages/0x.js/test/expiration_watcher_test.ts
index 0d5ebb909..0f2470070 100644
--- a/packages/0x.js/test/expiration_watcher_test.ts
+++ b/packages/0x.js/test/expiration_watcher_test.ts
@@ -12,11 +12,13 @@ import {TokenUtils} from './utils/token_utils';
import {ExpirationWatcher} from '../src/order_watcher/expiration_watcher';
import {Token, DoneCallback} from '../src/types';
import {ZeroEx} from '../src/0x';
+import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
import {FillScenarios} from './utils/fill_scenarios';
import {reportCallbackErrors} from './utils/report_callback_errors';
chaiSetup.configure();
const expect = chai.expect;
+const blockchainLifecycle = new BlockchainLifecycle();
describe('ExpirationWatcher', () => {
let web3: Web3;
@@ -52,14 +54,16 @@ describe('ExpirationWatcher', () => {
makerTokenAddress = makerToken.address;
takerTokenAddress = takerToken.address;
});
- beforeEach(() => {
+ beforeEach(async () => {
+ await blockchainLifecycle.startAsync();
const sinonTimerConfig = {shouldAdvanceTime: true} as any;
// This constructor has incorrect types
timer = Sinon.useFakeTimers(sinonTimerConfig);
currentUnixTimestampSec = utils.getCurrentUnixTimestampSec();
expirationWatcher = new ExpirationWatcher();
});
- afterEach(() => {
+ afterEach(async () => {
+ await blockchainLifecycle.revertAsync();
timer.restore();
expirationWatcher.unsubscribe();
});