mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
25 lines
722 B
JavaScript
25 lines
722 B
JavaScript
|
var chai = require('chai');
|
||
|
var assert = chai.assert;
|
||
|
var formatters = require('../lib/web3/formatters');
|
||
|
|
||
|
var tests = [
|
||
|
{ value: 'latest', expected: 'latest' },
|
||
|
{ value: 'pending', expected: 'pending' },
|
||
|
{ value: 'earliest', expected: 'earliest' },
|
||
|
{ value: 1, expected: '0x1' },
|
||
|
{ value: '0x1', expected: '0x1' }
|
||
|
];
|
||
|
|
||
|
describe('lib/web3/formatters', function () {
|
||
|
describe('inputDefaultBlockNumberFormatter', function () {
|
||
|
tests.forEach(function (test) {
|
||
|
it('should turn ' + test.value + ' to ' + test.expected, function () {
|
||
|
assert.strictEqual(formatters.inputDefaultBlockNumberFormatter(test.value), test.expected);
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|