Skip to content

Commit

Permalink
Don't apply location filtering if none is relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhubail committed Aug 27, 2024
1 parent f9e5d59 commit 02f9efc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/runner/src/utils/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ export function interpretTaskModes(
if (namePattern && !getTaskFullName(t).match(namePattern)) {
t.mode = 'skip'
}
if (locationFilters) {
const relevantFilters = locationFilters.filter(
f => t.file.filepath.includes(f.filename),
)

const relevantFilters = locationFilters?.filter(
f => t.file.filepath.includes(f.filename),
)

if (relevantFilters && relevantFilters.length !== 0) {
t.mode = relevantFilters.some(f => f.lineNumber === t.location?.line)
? 'run'
: 'skip'
Expand Down

0 comments on commit 02f9efc

Please sign in to comment.