-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: automatic checks file filter to be exclusion only to keep it simple #84
fix: automatic checks file filter to be exclusion only to keep it simple #84
Conversation
Codecov Report
@@ Coverage Diff @@
## master #84 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 323 322 -1
Branches 58 57 -1
=========================================
- Hits 323 322 -1
|
Looks Good To Me |
packages/jest/src/automatic.ts
Outdated
) { | ||
export function skipTest(testPath: string, filesFilter?: string[]): boolean { | ||
if (!filesFilter || !(filesFilter?.length > 0)) return false; | ||
const skipTest = filesFilter.some((fileName) => RegExp(fileName).test(testPath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect the filesFilter entries to be the full file paths? If so, it's probably better to do a string comparison (if not === then a startsWith or contains or similar) instead of using a regex. I see how regex made sense before since we let them use the !
negation, but to only exclude specific file paths I think a full regex is a little heavy handed.
Bug Fixes 🐛