mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-24 03:58:13 +00:00
16 lines
559 B
JavaScript
16 lines
559 B
JavaScript
|
var assert = require('assert');
|
||
|
var utils = require('../packages/web3-utils');
|
||
|
|
||
|
describe('lib/utils/utils', function () {
|
||
|
describe('toNumberString', function () {
|
||
|
it('should return the correct value', function () {
|
||
|
|
||
|
assert.equal(utils.toNumberString("0x3e8"), 1000);
|
||
|
assert.equal(utils.toNumberString('0x1f0fe294a36'), 2134567897654);
|
||
|
// allow compatiblity
|
||
|
assert.equal(utils.toNumberString(100000), 100000);
|
||
|
assert.equal(utils.toNumberString('100000'), 100000);
|
||
|
});
|
||
|
});
|
||
|
});
|