Skip to content

Conversation

@kyrstenkelly
Copy link

@kyrstenkelly kyrstenkelly commented May 8, 2020

I need to be able to set some sort of threshold for a # of violations that are allowed.
I tried to get this working by setting skipFailures = true, and using the violationsCallback to run my own assertions, but running assertions in that callback makes the tests behave weirdly.

I have currently forked this repo so I can add this parameter, but I would love if it got included here so I could keep using this repo instead!

@kyrstenkelly kyrstenkelly changed the title feat: Add parameter for setting failure threshold Add parameter for setting failure threshold May 8, 2020
@kyrstenkelly kyrstenkelly force-pushed the kyrsten/failure-threshold branch from 56ad935 to 58c497d Compare May 8, 2020 19:04
@dwightjack
Copy link

I'd need something like this as well. Is there any blocker from merging the PR?

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request!

I was thinking about adding an option to define which severities should fail tests, and this one could be a good addition too.

  1. I'm thinking about a new API for the next major release, and probably we'll need to replace all positional arguments of checkA11y with an object because we already have way too many and they are all optional.

  2. The name of the parameter. Maybe maxViolations similar to ESLint's maxWarnings would be more clear?

I'll keep this pull request as a reference, and either include in the new version or ask you to rebase it on top of it.

@sapegin sapegin added this to the 1.0.0: New API milestone Oct 26, 2020
@sapegin sapegin mentioned this pull request Nov 11, 2020
@sapegin
Copy link
Member

sapegin commented Nov 11, 2020

@kyrstenkelly I drafted my ideas on the new API: #75. I hope this covers your use case — let me know what you think.

@kyrstenkelly
Copy link
Author

@sapegin I'm loving the new API proposal (also 👍🏻 TS). In the mean time, we already long ago forked this repo and made the changes I had suggested here. Once the new API is done, I'll be excited to get rid of our fork and switch back to this lib. :)

@kyrstenkelly kyrstenkelly deleted the kyrsten/failure-threshold branch November 19, 2020 16:23
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.

3 participants