Skip to content

Commit 16f0d4a

Browse files
mostafahgaearon
authored andcommitted
Add "node" to Jest's moduleFileExtensions (#2738)
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.
1 parent 804ac00 commit 16f0d4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-scripts/scripts/utils/createJestConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
4343
moduleNameMapper: {
4444
'^react-native$': 'react-native-web',
4545
},
46-
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx'],
46+
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx', 'node'],
4747
};
4848
if (rootDir) {
4949
config.rootDir = rootDir;

0 commit comments

Comments
 (0)