You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
792 B
26 lines
792 B
var chai = require('chai');
|
|
var utils = require('../lib/utils/utils.js');
|
|
var BigNumber = require('bignumber.js');
|
|
var assert = chai.assert;
|
|
|
|
var tests = [
|
|
{ value: function () {}, is: false},
|
|
{ value: new Function(), is: false},
|
|
{ value: 'function', is: false},
|
|
{ value: {}, is: false},
|
|
{ value: new String('hello'), is: false},
|
|
{ value: new BigNumber(0), is: true},
|
|
{ value: 132, is: false},
|
|
{ value: '0x12', is: false},
|
|
|
|
];
|
|
|
|
describe('lib/utils/utils', function () {
|
|
describe('isBigNumber', function () {
|
|
tests.forEach(function (test) {
|
|
it('shoud test if value ' + test.func + ' is BigNumber: ' + test.is, function () {
|
|
assert.equal(utils.isBigNumber(test.value), test.is);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|