From f61a6b8bfb523c37797673671cb23ae5421ed1e0 Mon Sep 17 00:00:00 2001 From: Justin-ZS Date: Fri, 22 Dec 2017 21:41:37 +0800 Subject: [PATCH 1/3] Update condition to avoid infinite recursion in Windows platform --- packages/jest-config/src/resolve_config_path.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-config/src/resolve_config_path.js b/packages/jest-config/src/resolve_config_path.js index 9e35582b01db..1494552d44cc 100644 --- a/packages/jest-config/src/resolve_config_path.js +++ b/packages/jest-config/src/resolve_config_path.js @@ -66,7 +66,7 @@ const resolveConfigPathByTraversing = ( // This is the system root. // We tried everything, config is nowhere to be found ¯\_(ツ)_/¯ - if (pathToResolve === path.sep) { + if (pathToResolve === path.dirname(pathToResolve)) { throw new Error(makeResolutionErrorMessage(initialPath, cwd)); } From fe40605cab39918d17b4408f7ddd172a6f15f951 Mon Sep 17 00:00:00 2001 From: Justin-ZS Date: Fri, 22 Dec 2017 22:07:50 +0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e4503e4dfeb..d072ee946bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ None for now * `[jest-runtime]` fix error for test files providing coverage. ([#5117](https://github.com/facebook/jest/pull/5117)) +* `[jest-config]` fix unexpected condition to avoid infinite recursion in Windows platform.([#5161](https://github.com/facebook/jest/pull/5161)) ### Features From ac59fdaab395ed18eec73fd7ecd12a345294ad84 Mon Sep 17 00:00:00 2001 From: Justin-ZS Date: Sat, 23 Dec 2017 15:21:59 +0800 Subject: [PATCH 3/3] Remove `skipOnWindows` since tests run fine on windows --- .../jest-config/src/__tests__/resolve_config_path.test.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/jest-config/src/__tests__/resolve_config_path.test.js b/packages/jest-config/src/__tests__/resolve_config_path.test.js index 59f0be86b9ef..e9a60a3a8c52 100644 --- a/packages/jest-config/src/__tests__/resolve_config_path.test.js +++ b/packages/jest-config/src/__tests__/resolve_config_path.test.js @@ -11,12 +11,8 @@ import os from 'os'; import path from 'path'; import resolveConfigPath from '../resolve_config_path'; -import skipOnWindows from '../../../../scripts/skip_on_windows'; - const {cleanup, writeFiles} = require('../../../../integration_tests/utils'); -skipOnWindows.suite(); - const DIR = path.resolve(os.tmpdir(), 'resolve_config_path_test'); const ERROR_PATTERN = /Could not find a config file based on provided values/; const NO_ROOT_DIR_ERROR_PATTERN = /Can\'t find a root directory/;