1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-26 00:48:35 +00:00

Added jest

This commit is contained in:
Vladimír Volek 2018-07-30 13:44:39 +02:00
parent 7627aade89
commit c6292a1375
5 changed files with 1250 additions and 43 deletions

2
.gitignore vendored
View File

@ -18,3 +18,5 @@ logs
.yarnclean .yarnclean
_old _old
coverage

11
jest.config.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = {
collectCoverage: true,
testURL: 'http://localhost',
modulePathIgnorePatterns: [
'node_modules',
],
transformIgnorePatterns: [
'src/babel',
],
};

View File

@ -18,10 +18,12 @@
"dev": "webpack-dev-server --config ./webpack/config.dev.babel.js --mode development", "dev": "webpack-dev-server --config ./webpack/config.dev.babel.js --mode development",
"build": "rm -rf build && webpack --config ./webpack/config.prod.babel.js --progress", "build": "rm -rf build && webpack --config ./webpack/config.prod.babel.js --progress",
"flow": "flow check src/js", "flow": "flow check src/js",
"test": "", "lint": "npx eslint ./src ./webpack",
"lint": "npx eslint ./ --fix" "test-unit": "jest",
"test-unit:watch": "jest -o --watch"
}, },
"dependencies": { "dependencies": {
"bignumber.js": "^7.2.1",
"color-hash": "^1.0.3", "color-hash": "^1.0.3",
"copy-webpack-plugin": "^4.5.2", "copy-webpack-plugin": "^4.5.2",
"ethereumjs-tx": "^1.3.3", "ethereumjs-tx": "^1.3.3",
@ -50,13 +52,15 @@
"redux-thunk": "^2.2.0", "redux-thunk": "^2.2.0",
"trezor-connect": "5.0.13", "trezor-connect": "5.0.13",
"web3": "^0.19.0", "web3": "^0.19.0",
"webpack": "^4.16.3" "webpack": "^4.16.3",
"whatwg-fetch": "^2.0.4",
"yarn-run-all": "^3.1.1"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.24.1", "babel-cli": "^6.24.1",
"babel-eslint": "^8.2.6", "babel-eslint": "^8.2.6",
"babel-loader": "7.1.4", "babel-loader": "7.1.4",
"babel-plugin-root-import": "^5.1.0", "babel-plugin-root-import": "^6.1.0",
"babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-object-rest-spread": "^6.23.0",
@ -73,11 +77,11 @@
"eslint-plugin-react": "^7.10.0", "eslint-plugin-react": "^7.10.0",
"file-loader": "1.1.11", "file-loader": "1.1.11",
"flow-bin": "0.72.0", "flow-bin": "0.72.0",
"jest": "^23.4.2",
"less": "^3.0.1", "less": "^3.0.1",
"less-loader": "4.1.0", "less-loader": "4.1.0",
"webpack-cli": "^2.1.3", "webpack-cli": "^2.1.3",
"webpack-dev-server": "^3.1.4", "webpack-dev-server": "^3.1.4",
"whatwg-fetch": "^2.0.3",
"yargs": "11.0.0" "yargs": "11.0.0"
} }
} }

View File

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

1255
yarn.lock

File diff suppressed because it is too large Load Diff