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

Add toAlways, the inverse of toNever. #969

Merged
merged 1 commit into from
Apr 16, 2022
Merged

Conversation

younata
Copy link
Member

@younata younata commented Mar 4, 2022

toNever was added somewhat recently, where we verify that a matcher continues to fail until the timeout happens. It felt odd to me that there wasn't a way to verify that a watcher continues to succeed until the timeout happens. So I added toAlways to capture that.

This adjusts how the private async function works, to also take in the behavior that we want the predicate to always match. I briefly looked into consolidating AsyncMatchStyle.never and AsyncMatchStyle.always because they are very similar, but decided against DRY'ing that up because it would unnecessarily add complexity.

This also adds documentation in the README around how to use toNever and toAlways. It's not great documentation, but I hope this gets the idea across.

  • Does this have tests?
  • Does this have documentation?
  • Does not break the public API.
  • Is this a new feature (Requires minor version bump)?

@younata younata added this to the v10 milestone Apr 14, 2022
Document toAlways and toNever
@jessesquires
Copy link
Member

Rebasing this to re-run CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants