diff --git a/CHANGELOG.md b/CHANGELOG.md index 8caaba089165..c8a48c7b9beb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,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 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/; 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)); }