Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #28422 - use jest instead of jest-cli #7230

Merged
merged 1 commit into from
Dec 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ module.exports = {
unmockedModulePathPatterns: ['react', 'node_modules/'],
moduleNameMapper: {
'^.+\\.(png|gif|css|scss)$': 'identity-obj-proxy',
"^dnd-core$": "dnd-core/dist/cjs/index.js",
"^react-dnd$": "react-dnd/dist/cjs/index.js",
"^react-dnd-html5-backend$": "react-dnd-html5-backend/dist/cjs/index.js",
"^react-dnd-test-backend$": "react-dnd-test-backend/dist/cjs/index.js",
"^react-dnd-test-utils$": "react-dnd-test-utils/dist/cjs/index.js"
'^dnd-core$': 'dnd-core/dist/cjs/index.js',
'^react-dnd$': 'react-dnd/dist/cjs/index.js',
'^react-dnd-html5-backend$': 'react-dnd-html5-backend/dist/cjs/index.js',
'^react-dnd-test-backend$': 'react-dnd-test-backend/dist/cjs/index.js',
'^react-dnd-test-utils$': 'react-dnd-test-utils/dist/cjs/index.js',
},
globals: {
__testing__: true,
Expand All @@ -31,7 +31,10 @@ module.exports = {
transform: {
'^.+\\.js$': 'babel-jest',
},
moduleDirectories: ['node_modules/@theforeman/vendor-core/node_modules', 'node_modules'],
moduleDirectories: [
'node_modules/@theforeman/vendor-core/node_modules',
'node_modules',
],
setupFiles: [
'raf/polyfill',
'jest-prop-type-error',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "./node_modules/.bin/eslint -c .eslintrc webpack/ script/",
"foreman-js:link": "./script/npm_link_foreman_js.sh",
"postlint": "./script/npm_lint_plugins.js",
"test": "node --max_old_space_size=8192 node_modules/.bin/jest --no-cache --config config/jest.config.js",
"test": "jest --config config/jest.config.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is absolutely amazing !
with cache:
tests on first run: 160 seconds,
on second time: 80 seconds,
on third time: 40 seconds,
on 4th time: 18 seconds

"test:watch": "node node_modules/.bin/jest --watchAll --config config/jest.config.js",
"test:current": "node node_modules/.bin/jest --watch --config config/jest.config.js",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
Expand Down Expand Up @@ -60,7 +60,7 @@
"file-loader": "^0.9.0",
"highlight.js": "~9.14.0",
"identity-obj-proxy": "^3.0.0",
"jest-cli": "^24.9.0",
"jest": "^24.9.0",
"jest-prop-type-error": "^1.1.0",
"node-sass": "^4.5.0",
"prettier": "^1.19.1",
Expand Down