Skip to content

Commit

Permalink
Add "node" to Jest's moduleFileExtensions (facebook#2738)
Browse files Browse the repository at this point in the history
Jest's default value for this option is ["js", "json", "jsx", "node"].
CRA's current value is ["web.js", "js", "json", "web.jsx", "jsx"], which
is missing one of default ones: "node". This change fixes that.

This "node" extension is used in packages that use native code.
  • Loading branch information
mostafah authored and romaindso committed Jul 10, 2017
1 parent 745ea23 commit 96901ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
moduleNameMapper: {
'^react-native$': 'react-native-web',
},
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx'],
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx', 'node'],
};
if (rootDir) {
config.rootDir = rootDir;
Expand Down

0 comments on commit 96901ac

Please sign in to comment.