From aeec2a96b09b90ed98e0d21ee9467bda38f3b72c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 6 Jun 2017 11:28:11 +0200 Subject: Address feedback --- test/0x.js_test.ts | 4 ++-- test/chai_setup.ts | 13 ------------- test/exchange_wrapper_test.ts | 4 ++-- test/token_registry_wrapper_test.ts | 4 ++-- test/token_wrapper_test.ts | 4 ++-- test/utils/chai_setup.ts | 13 +++++++++++++ 6 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 test/chai_setup.ts create mode 100644 test/utils/chai_setup.ts diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index d2a36e1c4..42dbeee9f 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -1,6 +1,6 @@ import * as _ from 'lodash'; import * as chai from 'chai'; -import {ChaiSetup} from './chai_setup'; +import {chaiSetup} from './utils/chai_setup'; import 'mocha'; import * as BigNumber from 'bignumber.js'; import * as Sinon from 'sinon'; @@ -9,7 +9,7 @@ import {constants} from './utils/constants'; import {web3Factory} from './utils/web3_factory'; import {Order} from '../src/types'; -ChaiSetup.configure(); +chaiSetup.configure(); const expect = chai.expect; describe('ZeroEx library', () => { diff --git a/test/chai_setup.ts b/test/chai_setup.ts deleted file mode 100644 index df71c960f..000000000 --- a/test/chai_setup.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as chai from 'chai'; -import * as dirtyChai from 'dirty-chai'; -import ChaiBigNumber = require('chai-bignumber'); -import chaiAsPromised = require('chai-as-promised'); - -export class ChaiSetup { - public static configure(): void { - chai.config.includeStack = true; - chai.use(ChaiBigNumber()); - chai.use(dirtyChai); - chai.use(chaiAsPromised); - } -} diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index ac0a2199e..37f7b4941 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -2,7 +2,7 @@ import 'mocha'; import * as chai from 'chai'; import * as Web3 from 'web3'; import * as BigNumber from 'bignumber.js'; -import {ChaiSetup} from './chai_setup'; +import {chaiSetup} from './utils/chai_setup'; import ChaiBigNumber = require('chai-bignumber'); import promisify = require('es6-promisify'); import {web3Factory} from './utils/web3_factory'; @@ -20,7 +20,7 @@ import { import {FillScenarios} from './utils/fill_scenarios'; import {TokenUtils} from './utils/token_utils'; -ChaiSetup.configure(); +chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(); diff --git a/test/token_registry_wrapper_test.ts b/test/token_registry_wrapper_test.ts index cf2fa267b..33c4a8054 100644 --- a/test/token_registry_wrapper_test.ts +++ b/test/token_registry_wrapper_test.ts @@ -1,14 +1,14 @@ import * as _ from 'lodash'; import 'mocha'; import * as chai from 'chai'; -import {ChaiSetup} from './chai_setup'; +import {chaiSetup} from './utils/chai_setup'; import {web3Factory} from './utils/web3_factory'; import {ZeroEx} from '../src/0x.js'; import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; import {SchemaValidator} from '../src/utils/schema_validator'; import {tokenSchema} from '../src/schemas/token_schema'; -ChaiSetup.configure(); +chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(); diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index f9f231828..c258f8317 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -1,6 +1,6 @@ import 'mocha'; import * as chai from 'chai'; -import {ChaiSetup} from './chai_setup'; +import {chaiSetup} from './utils/chai_setup'; import * as Web3 from 'web3'; import * as BigNumber from 'bignumber.js'; import promisify = require('es6-promisify'); @@ -9,7 +9,7 @@ import {ZeroEx} from '../src/0x.js'; import {ZeroExError, Token} from '../src/types'; import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; -ChaiSetup.configure(); +chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(); diff --git a/test/utils/chai_setup.ts b/test/utils/chai_setup.ts new file mode 100644 index 000000000..1b9783724 --- /dev/null +++ b/test/utils/chai_setup.ts @@ -0,0 +1,13 @@ +import * as chai from 'chai'; +import * as dirtyChai from 'dirty-chai'; +import ChaiBigNumber = require('chai-bignumber'); +import chaiAsPromised = require('chai-as-promised'); + +export const chaiSetup = { + configure: () => { + chai.config.includeStack = true; + chai.use(ChaiBigNumber()); + chai.use(dirtyChai); + chai.use(chaiAsPromised); + }, +}; -- cgit v1.2.3