Skip to content

Commit

Permalink
adds test coverage to jest config
Browse files Browse the repository at this point in the history
closes ProjectMirador#72
removes jest config from package.json and adds jest config file
adds ignores for coverage dir
  • Loading branch information
christopher-johnson committed Dec 13, 2018
1 parent 20436d4 commit 6f64b44
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 24 deletions.
1 change: 1 addition & 0 deletions minimal_redux_poc/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
config/
coverage/
2 changes: 1 addition & 1 deletion minimal_redux_poc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist/
coverage/

.idea
15 changes: 15 additions & 0 deletions minimal_redux_poc/jest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"collectCoverageFrom": [
"src/**/*.{js,jsx}"
],
"coverageDirectory": "<rootDir>/coverage",
"coverageReporters": ["html"],
"setupFiles": [
"<rootDir>/setupJest.js"
],
"testMatch": [
"<rootDir>/**/__tests__/**/*.{js,jsx}",
"<rootDir>/src/**/?(*.)(spec|test|unit).{js,jsx}"
],
"preset": "jest-puppeteer"
}
49 changes: 37 additions & 12 deletions minimal_redux_poc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions minimal_redux_poc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"scripts": {
"lint": "node_modules/.bin/eslint ./",
"server": "node_modules/.bin/http-server",
"test": "npm run build && npm run lint && node_modules/.bin/jest",
"test:watch": "npm test -- --watch",
"test": "npm run build && npm run lint && jest -c jest.json",
"test:coverage": "jest -c jest.json --coverage",
"test:watch": "jest -c jest.json --watch",
"build": "webpack --mode=production",
"build:dev": "webpack --mode=development",
"build:watch": "webpack --watch --mode=development",
Expand Down Expand Up @@ -67,14 +68,5 @@
"style-loader": "^0.22.1",
"webpack": "^4.27.1",
"webpack-cli": "^3.1.2"
},
"jest": {
"preset": "jest-puppeteer",
"setupFiles": [
"./setupJest.js"
],
"testPathIgnorePatterns": [
"__tests__/integration/react-example/.*jsx?"
]
}
}

0 comments on commit 6f64b44

Please sign in to comment.