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

WIP: haste ignores using testPathIgnorePatterns, not all node_modules #2318

Closed
Closed
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
5 changes: 1 addition & 4 deletions packages/jest-haste-map/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,7 @@ class HasteMap extends EventEmitter {
* Helpers
*/
_ignore(filePath: Path): boolean {
return (
this._options.ignorePattern.test(filePath) ||
(!this._options.retainAllFiles && this._isNodeModulesDir(filePath))
);
return this._options.ignorePattern.test(filePath);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot remove this option as we are using it at FB.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead maybe we could add config.testPathIgnorePatterns to this._whitelist?

_isNodeModulesDir(filePath: Path): boolean {
Expand Down
4 changes: 3 additions & 1 deletion packages/jest-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ class Runtime {
options?: HasteMapOptions,
): HasteMap {
const ignorePattern = new RegExp(
[config.cacheDirectory].concat(config.modulePathIgnorePatterns).join('|'),
[config.cacheDirectory].concat(
config.modulePathIgnorePatterns,
config.testPathIgnorePatterns).join('|'),
);

return new HasteMap({
Expand Down