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

core(config): Throw an error if an onlyX filter is an empty array #1

Merged
merged 2 commits into from
May 27, 2023

Conversation

OronW
Copy link
Owner

@OronW OronW commented May 27, 2023

Summary
This is a bugfix, which fixes this issue:
GoogleChrome#14986
Logic fix and relevant unit tests were added.

Description
TLDR: Throw an Error In case and empty array of onlyCategories / onlyAudits is passed

In the case an empty array of onlyCategories is passed, all categories are filtered (as only 0 categories are to be kept).
This results in an unexpected behavior, as an empty array might be interpreted as "don't filter anything".
Since passing an empty array serves no use, an error is thrown.

TBD
The original issue referred to throwing an error also for the case in which audits is left empty after filtering, however empty/missing audits is being handled in following code, and throwing an error breaks this logic.
Throwing an error for empty audits also breaks 30 tests.

I would suggest not changing any audits logic.

@OronW OronW merged commit 0d07e2a into main May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant