Skip to content

Commit

Permalink
Upgrade Jest to 17.0 (#1078)
Browse files Browse the repository at this point in the history
* Replace `scriptPreprocessor` config with `transform`.
* Also remove `moduleFileExtensions` which has been redundant since 16.0
  (`['js', 'json', 'jsx', 'node’]` is the default)
  • Loading branch information
fson authored Nov 21, 2016
1 parent 2da6eda commit 7e9cb18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"autoprefixer": "6.5.1",
"babel-core": "6.17.0",
"babel-eslint": "7.0.0",
"babel-jest": "16.0.0",
"babel-jest": "17.0.2",
"babel-loader": "6.2.7",
"babel-preset-react-app": "^1.0.0",
"case-sensitive-paths-webpack-plugin": "1.1.4",
Expand All @@ -50,7 +50,7 @@
"gzip-size": "3.0.0",
"html-webpack-plugin": "2.24.0",
"http-proxy-middleware": "0.17.2",
"jest": "16.0.2",
"jest": "17.0.2",
"json-loader": "0.5.4",
"object-assign": "4.1.0",
"path-exists": "2.1.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/react-scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = (resolve, rootDir, isEjecting) => {

const config = {
collectCoverageFrom: ['src/**/*.{js,jsx}'],
moduleFileExtensions: ['jsx', 'js', 'json'],
moduleNameMapper: {
'^.+\\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'),
'^.+\\.css$': resolve('config/jest/CSSStub.js')
Expand All @@ -35,7 +34,9 @@ module.exports = (resolve, rootDir, isEjecting) => {
if (!isEjecting) {
// This is unnecessary after ejecting because Jest
// will just use .babelrc in the project folder.
config.scriptPreprocessor = resolve('config/jest/transform.js');
config.transform = {
'^.+\\.(js|jsx)$': resolve('config/jest/transform.js'),
};
}
return config;
};

0 comments on commit 7e9cb18

Please sign in to comment.