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.
22 lines
1.3 KiB
22 lines
1.3 KiB
var assert = require('assert');
|
|
var utils = require('../lib/utils/utils.js');
|
|
|
|
describe('lib/utils/utils', function () {
|
|
describe('fromWei', function () {
|
|
it('should return the correct value', function () {
|
|
|
|
assert.equal(utils.fromWei(1000000000000000000, 'wei'), '1000000000000000000');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'kwei'), '1000000000000000');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'mwei'), '1000000000000');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'gwei'), '1000000000');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'szabo'), '1000000');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'finney'), '1000');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'ether'), '1');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'kether'), '0.001');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'grand'), '0.001');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'mether'), '0.000001');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'gether'), '0.000000001');
|
|
assert.equal(utils.fromWei(1000000000000000000, 'tether'), '0.000000000001');
|
|
});
|
|
});
|
|
});
|
|
|