Skip to content

Add toAlways, the inverse of toNever.#969

Merged
younata merged 1 commit intoQuick:mainfrom
younata:add_toAlways
Apr 16, 2022
Merged

Add toAlways, the inverse of toNever.#969
younata merged 1 commit intoQuick:mainfrom
younata:add_toAlways

Conversation

@younata
Copy link
Copy Markdown
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
Copy Markdown
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