-
Notifications
You must be signed in to change notification settings - Fork 665
Open
Labels
suggestiona suggestion yet to be agreeda suggestion yet to be agreed
Description
Is your feature request related to a problem? Please describe.
in vitest we can use async functions as a callback to describe(), which allows setting up group-related resource, e.g.:
describe('foo', async () => {
const foo = await createFoo()
afterAll(() => foo.destroy())
// ... tests ...
})however describe currently doesn't allow async functions to be passed
Describe the solution you'd like
support async describe callbacks
Describe alternatives you've considered
- move all
awaits to top level - the downside is that group-related stuff stops being grouped - initialize everything with a
beforeAllhook - the downside is that we have to use non-null assertions for typescript + increases boilerplate
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
suggestiona suggestion yet to be agreeda suggestion yet to be agreed