mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-28 03:08:30 +00:00
100% coverage in eth utils
This commit is contained in:
parent
1a6c90bec0
commit
7b22a965b6
@ -22,6 +22,8 @@ exports[`eth utils hexToDecimal 4`] = `"1"`;
|
|||||||
|
|
||||||
exports[`eth utils hexToDecimal 5`] = `"0"`;
|
exports[`eth utils hexToDecimal 5`] = `"0"`;
|
||||||
|
|
||||||
|
exports[`eth utils hexToDecimal 6`] = `"null"`;
|
||||||
|
|
||||||
exports[`eth utils padLeftEven 1`] = `"02540be3ff"`;
|
exports[`eth utils padLeftEven 1`] = `"02540be3ff"`;
|
||||||
|
|
||||||
exports[`eth utils sanitizeHex 1`] = `"0x02540be3ff"`;
|
exports[`eth utils sanitizeHex 1`] = `"0x02540be3ff"`;
|
||||||
@ -34,6 +36,10 @@ exports[`eth utils sanitizeHex 4`] = `"0x0100"`;
|
|||||||
|
|
||||||
exports[`eth utils sanitizeHex 5`] = `null`;
|
exports[`eth utils sanitizeHex 5`] = `null`;
|
||||||
|
|
||||||
|
exports[`eth utils sanitizeHex 6`] = `""`;
|
||||||
|
|
||||||
exports[`eth utils strip 1`] = `""`;
|
exports[`eth utils strip 1`] = `""`;
|
||||||
|
|
||||||
exports[`eth utils strip 2`] = `"02540be3ff"`;
|
exports[`eth utils strip 2`] = `"02540be3ff"`;
|
||||||
|
|
||||||
|
exports[`eth utils strip 3`] = `"02540be3ff"`;
|
||||||
|
@ -11,7 +11,7 @@ describe('eth utils', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('hexToDecimal', () => {
|
it('hexToDecimal', () => {
|
||||||
const input = ['2540be3ff', '64', '2', '1', '0'];
|
const input = ['2540be3ff', '64', '2', '1', '0', ''];
|
||||||
|
|
||||||
input.forEach((entry) => {
|
input.forEach((entry) => {
|
||||||
expect(ethUtils.hexToDecimal(entry)).toMatchSnapshot();
|
expect(ethUtils.hexToDecimal(entry)).toMatchSnapshot();
|
||||||
@ -27,7 +27,7 @@ describe('eth utils', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sanitizeHex', () => {
|
it('sanitizeHex', () => {
|
||||||
const input = ['0x2540be3ff', '1', '2', '100', 999];
|
const input = ['0x2540be3ff', '1', '2', '100', 999, ''];
|
||||||
|
|
||||||
input.forEach((entry) => {
|
input.forEach((entry) => {
|
||||||
expect(ethUtils.sanitizeHex(entry)).toMatchSnapshot();
|
expect(ethUtils.sanitizeHex(entry)).toMatchSnapshot();
|
||||||
@ -36,7 +36,7 @@ describe('eth utils', () => {
|
|||||||
|
|
||||||
|
|
||||||
it('strip', () => {
|
it('strip', () => {
|
||||||
const input = ['0x', '0x2540be3ff'];
|
const input = ['0x', '0x2540be3ff', '2540be3ff'];
|
||||||
|
|
||||||
input.forEach((entry) => {
|
input.forEach((entry) => {
|
||||||
expect(ethUtils.strip(entry)).toMatchSnapshot();
|
expect(ethUtils.strip(entry)).toMatchSnapshot();
|
||||||
|
Loading…
Reference in New Issue
Block a user