mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-25 16:38:08 +00:00
Added jest
This commit is contained in:
parent
7627aade89
commit
c6292a1375
4
.gitignore
vendored
4
.gitignore
vendored
@ -17,4 +17,6 @@ logs
|
|||||||
*.log
|
*.log
|
||||||
.yarnclean
|
.yarnclean
|
||||||
|
|
||||||
_old
|
_old
|
||||||
|
|
||||||
|
coverage
|
11
jest.config.js
Normal file
11
jest.config.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module.exports = {
|
||||||
|
collectCoverage: true,
|
||||||
|
testURL: 'http://localhost',
|
||||||
|
|
||||||
|
modulePathIgnorePatterns: [
|
||||||
|
'node_modules',
|
||||||
|
],
|
||||||
|
transformIgnorePatterns: [
|
||||||
|
'src/babel',
|
||||||
|
],
|
||||||
|
};
|
14
package.json
14
package.json
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9
src/js/utils/__tests__/ethUtils.test.js
Normal file
9
src/js/utils/__tests__/ethUtils.test.js
Normal 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();
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user