Commit 43bd334
fix: prevent false positive test file detection for projects in /tests/ folders
When a project is located inside a directory named "tests" (e.g.,
/home/user/tests/myproject), source files were incorrectly filtered
as test files because the full path contained "/tests/".
The fix ensures directory pattern matching (/test/, /tests/, /__tests__/)
only applies to the relative path from project root, not parent directories.
If the relative path cannot be computed, we now skip directory pattern
matching entirely instead of checking the full path.
Example:
- Before: /home/user/tests/myproject/src/utils.ts was filtered as test file
- After: Only checks if /src/utils.ts contains /tests/ (correctly returns false)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 2f19cdd commit 43bd334
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
842 | | - | |
843 | | - | |
| 842 | + | |
844 | 843 | | |
845 | 844 | | |
846 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| |||
0 commit comments