Skip to content

Commit 02df66d

Browse files
committed
fixed jest coverage
1 parent 9a6bd59 commit 02df66d

File tree

3 files changed

+124
-34
lines changed

3 files changed

+124
-34
lines changed

frontend/package-lock.json

Lines changed: 113 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55
"main": "index.js",
66
"scripts": {
77
"coverage": "cross-env NODE_ENV=test nyc -x **/node_modules/** mocha --recursive js/**/*.jsx",
8-
"test": "cross-env NODE_ENV=test jest --coverage -t /tests/mocha/*.js",
8+
"test": "cross-env NODE_ENV=test jest --coverage --collectCoverageFrom=js/**/**",
99
"watch": "webpack-cli --progress -d --config webpack.config.js --watch",
1010
"dev": "webpack -d --config webpack.config.js --progress --hide-modules --host 127.0.0.1 --port 80",
1111
"prod": "webpack -p --config webpack.config.js --progress --hide-modules --host 127.0.0.1 --port 80"
1212
},
13+
"jest": {
14+
"transform": {
15+
"^.+\\.(js|jsx|ts)$": "babel-jest"
16+
}
17+
},
1318
"author": "",
1419
"license": "ISC",
1520
"devDependencies": {
1621
"@babel/cli": "^7.2.3",
1722
"@babel/core": "^7.1.2",
23+
"@babel/plugin-proposal-class-properties": "^7.4.0",
1824
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
1925
"@babel/preset-env": "^7.2.3",
2026
"@babel/preset-react": "^7.0.0",
@@ -41,19 +47,13 @@
4147
"babel": {
4248
"plugins": [
4349
"@babel/plugin-syntax-jsx",
44-
"@babel/plugin-syntax-dynamic-import"
50+
"@babel/plugin-syntax-dynamic-import",
51+
"@babel/plugin-proposal-class-properties"
4552
],
4653
"presets": [
4754
"@babel/preset-env",
4855
"@babel/preset-react"
49-
],
50-
"env": {
51-
"test": {
52-
"plugins": [
53-
"istanbul"
54-
]
55-
}
56-
}
56+
]
5757
},
5858
"nyc": {
5959
"exclude": "/node_modules/*",
@@ -68,7 +68,6 @@
6868
"instrument": false
6969
},
7070
"dependencies": {
71-
"@babel/plugin-proposal-class-properties": "^7.1.0",
7271
"@fortawesome/fontawesome-svg-core": "^1.2.14",
7372
"@fortawesome/free-solid-svg-icons": "^5.7.1",
7473
"@fortawesome/react-fontawesome": "^0.1.4",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const sum = function(a, b){return a+b};
22

33
test('adds 1 + 2 to equal 3', () => {
4-
expect(sum(1, 2)).toBe(3);
4+
expect(sum(1, 2)).toBe(3);
55
});

0 commit comments

Comments
 (0)