From 3b723837f336501751788aacb0a33184b4b4dbc0 Mon Sep 17 00:00:00 2001 From: Aleks Hudochenkov Date: Mon, 2 Oct 2017 23:44:58 +0200 Subject: [PATCH] Use process.cwd as config.rootDir fallback Fixes #3499 and #3613 --- packages/jest-config/src/read_config_file_and_set_root_dir.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jest-config/src/read_config_file_and_set_root_dir.js b/packages/jest-config/src/read_config_file_and_set_root_dir.js index 2b0fb9749ec1..589c0b2a94e3 100644 --- a/packages/jest-config/src/read_config_file_and_set_root_dir.js +++ b/packages/jest-config/src/read_config_file_and_set_root_dir.js @@ -51,8 +51,8 @@ export default (configPath: Path): InitialOptions => { ); } } else { - // If rootDir is not there, we'll set it to this file's __dirname - configObject.rootDir = path.dirname(configPath); + // If rootDir is not there, we'll set it to cwd + configObject.rootDir = process.cwd(); } return configObject;