Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update condition to avoid infinite recursion in Windows platform #5161

Merged
merged 3 commits into from
Dec 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/src/resolve_config_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down