Prettier
This commit is contained in:
parent
fb77817c2d
commit
2ac806ef08
@ -3,6 +3,7 @@
|
|||||||
## v0.30.1 - _January 18, 2018_
|
## v0.30.1 - _January 18, 2018_
|
||||||
|
|
||||||
* Fix a bug allowing negative fill values (#212)
|
* Fix a bug allowing negative fill values (#212)
|
||||||
|
|
||||||
## v0.30.0 - _January 17, 2018_
|
## v0.30.0 - _January 17, 2018_
|
||||||
|
|
||||||
* Add an error parameter to the order watcher callback (#312)
|
* Add an error parameter to the order watcher callback (#312)
|
||||||
|
@ -13,7 +13,7 @@ export const assert = {
|
|||||||
isValidBaseUnitAmount(variableName: string, value: BigNumber) {
|
isValidBaseUnitAmount(variableName: string, value: BigNumber) {
|
||||||
assert.isBigNumber(variableName, value);
|
assert.isBigNumber(variableName, value);
|
||||||
const isNegative = value.lessThan(0);
|
const isNegative = value.lessThan(0);
|
||||||
this.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}` );
|
this.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}`);
|
||||||
const hasDecimals = value.decimalPlaces() !== 0;
|
const hasDecimals = value.decimalPlaces() !== 0;
|
||||||
this.assert(
|
this.assert(
|
||||||
!hasDecimals,
|
!hasDecimals,
|
||||||
|
@ -25,11 +25,15 @@ describe('Assertions', () => {
|
|||||||
describe('#isValidBaseUnitAmount', () => {
|
describe('#isValidBaseUnitAmount', () => {
|
||||||
it('should not throw for valid input', () => {
|
it('should not throw for valid input', () => {
|
||||||
const validInputs = [new BigNumber(23), new BigNumber('45000000')];
|
const validInputs = [new BigNumber(23), new BigNumber('45000000')];
|
||||||
validInputs.forEach(input => expect(assert.isValidBaseUnitAmount.bind(assert, variableName, input)).to.not.throw());
|
validInputs.forEach(input =>
|
||||||
|
expect(assert.isValidBaseUnitAmount.bind(assert, variableName, input)).to.not.throw(),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
it('should throw for invalid input', () => {
|
it('should throw for invalid input', () => {
|
||||||
const invalidInputs = [0, undefined, new BigNumber(3.145), 3.145, new BigNumber(-400)];
|
const invalidInputs = [0, undefined, new BigNumber(3.145), 3.145, new BigNumber(-400)];
|
||||||
invalidInputs.forEach(input => expect(assert.isValidBaseUnitAmount.bind(assert, variableName, input)).to.throw());
|
invalidInputs.forEach(input =>
|
||||||
|
expect(assert.isValidBaseUnitAmount.bind(assert, variableName, input)).to.throw(),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('#isString', () => {
|
describe('#isString', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user