1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

Added test snapshot and updated coverage

This commit is contained in:
Vladimír Volek 2018-07-30 14:17:49 +02:00
parent c7d21e8435
commit 7beb6131b8
3 changed files with 21 additions and 3 deletions

View File

@ -1,8 +1,12 @@
module.exports = {
rootDir: './src',
collectCoverage: true,
testURL: 'http://localhost',
modulePathIgnorePatterns: [
'node_modules',
],
collectCoverageFrom: [
'js/utils/**.js',
],
};

View File

@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`sds decimalToHex 1`] = `2`;
exports[`eth utils decimalToHex 1`] = `"0"`;
exports[`eth utils decimalToHex 2`] = `"1"`;
exports[`eth utils decimalToHex 3`] = `"2"`;
exports[`eth utils decimalToHex 4`] = `"64"`;
exports[`eth utils decimalToHex 5`] = `"3e7"`;

View File

@ -1,5 +1,11 @@
describe('sds', () => {
import * as ethUtils from '../ethUtils';
describe('eth utils', () => {
it('decimalToHex', () => {
expect(2).toMatchSnapshot();
const input = [0, 1, 2, 100, 999];
input.forEach((entry) => {
expect(ethUtils.decimalToHex(entry)).toMatchSnapshot();
});
});
});