Skip to content

Commit

Permalink
use _filterTestPathsWithStats to to filter by with testPathPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Mack Solomon committed Apr 12, 2019
1 parent 808564a commit f7eafee
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/jest-core/src/SearchSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,10 @@ export default class SearchSource {
globalConfig.collectCoverage,
);
if (globalConfig.testPathPattern !== null) {
return {
tests: relatedTests.tests.filter(test =>
new RegExp(globalConfig.testPathPattern).test(test.path),
),
};
return this._filterTestPathsWithStats(
relatedTests.tests,
globalConfig.testPathPattern.split('|').pop(),
);
} else {
return relatedTests;
}
Expand Down

0 comments on commit f7eafee

Please sign in to comment.