From a0240c353b0f94ab1f957aeb884b318416e3130e Mon Sep 17 00:00:00 2001 From: Mostafa Hajizadeh Date: Fri, 7 Jul 2017 15:07:32 +0430 Subject: [PATCH] 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. --- packages/react-scripts/scripts/utils/createJestConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index de74958efad..bc4ebf82271 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -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;