fixed CI tests for swapper

This commit is contained in:
David Sun
2019-11-16 13:53:50 -06:00
committed by Jacob Evans
parent c198d0079e
commit 7f00279ffb
4 changed files with 73 additions and 84 deletions

View File

@@ -3,14 +3,14 @@ import { BigNumber } from '@0x/utils';
import { InsufficientAssetLiquidityError } from '../../src/errors';
export const testHelpers = {
expectInsufficientLiquidityError: (
expectInsufficientLiquidityErrorAsync: async (
expect: Chai.ExpectStatic,
functionWhichTriggersError: () => void,
functionWhichTriggersErrorAsync: () => Promise<void>,
expectedAmountAvailableToFill: BigNumber,
): void => {
): Promise<void> => {
let wasErrorThrown = false;
try {
functionWhichTriggersError();
await functionWhichTriggersErrorAsync();
} catch (e) {
wasErrorThrown = true;
expect(e).to.be.instanceOf(InsufficientAssetLiquidityError);