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

transition towards local assertions #58

Merged
merged 1 commit into from
Mar 10, 2023
Merged

transition towards local assertions #58

merged 1 commit into from
Mar 10, 2023

Conversation

pygy
Copy link
Member

@pygy pygy commented Mar 10, 2023

This introduces an opt-in way to have local assertions and spies, that are aware of potential timeouts in async context.

o("some test", o=> {
  o(true).equals(true)
})

To be able to use this, you need to wrap the code in

o.localAssertions(()=>{
  /*specs and tests come here*/
})

... or have o.localAssertions() called before any spec is registered if you want it globally (using the --preload CLI options).

This will become the default API in v6, and the old one will be reachable through o.globalAssertions().

This fixes #50 and #54.

@pygy pygy merged commit 90d54e5 into main Mar 10, 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
Development

Successfully merging this pull request may close these issues.

Lost assertions in async tests
1 participant