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

fix: automatic checks file filter to be exclusion only to keep it simple #84

Merged
merged 9 commits into from
Nov 20, 2021

Conversation

mohanraj-r
Copy link
Contributor

@mohanraj-r mohanraj-r commented Nov 18, 2021

Bug Fixes 🐛

  • automatic checks file filter to be exclusion only to keep it simple
    • the filter was trying to do both inclusion and exclusion which led to complicated buggy code
  • add sa11y common pkg as dep instead of dev dep (fixes fix: missing pkg dependency of @sa11y/common #83)

@mohanraj-r mohanraj-r requested a review from a team as a code owner November 18, 2021 04:37
@mohanraj-r mohanraj-r self-assigned this Nov 18, 2021
@codecov
Copy link

codecov bot commented Nov 18, 2021

Codecov Report

Merging #84 (b8e0092) into master (32b02b7) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #84   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          323       322    -1     
  Branches        58        57    -1     
=========================================
- Hits           323       322    -1     
Impacted Files Coverage Δ
packages/jest/src/automatic.ts 100.00% <100.00%> (ø)

@mohanraj-r mohanraj-r requested review from vsadineni1 and removed request for vsadineni1 November 18, 2021 23:16
@venkatasadineni
Copy link

Looks Good To Me

) {
export function skipTest(testPath: string, filesFilter?: string[]): boolean {
if (!filesFilter || !(filesFilter?.length > 0)) return false;
const skipTest = filesFilter.some((fileName) => RegExp(fileName).test(testPath));

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.

@mohanraj-r mohanraj-r merged commit 6c900d7 into salesforce:master Nov 20, 2021
@mohanraj-r mohanraj-r deleted the fix_auto_files_filter branch November 20, 2021 03:43
@mohanraj-r mohanraj-r restored the fix_auto_files_filter branch November 20, 2021 03:43
@mohanraj-r mohanraj-r deleted the fix_auto_files_filter branch November 20, 2021 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: missing pkg dependency of @sa11y/common
3 participants