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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow async callback to describe #10271

Closed
stanlaktionov opened this issue Jul 13, 2020 · 2 comments
Closed

Allow async callback to describe #10271

stanlaktionov opened this issue Jul 13, 2020 · 2 comments

Comments

@stanlaktionov
Copy link

stanlaktionov commented Jul 13, 2020

馃殌 Feature Proposal

Allow async callback to describe

Motivation

I think it will be usefull to load async data in describe and then use in test.each or descibe.each (for example some ElementHanldes from pupeteer)

Example

descibe("async test", async () => {

      const data = await new DataLoader().load();

     it.each(data, async () => {
        expect(...).toEqual(...)
     })
}) 

@jeysal
Copy link
Contributor

jeysal commented Jul 13, 2020

Duplicate of #2235
We won't implement it because forcing all tests to be declared synchronously helps reporters and third party tooling e.g. know the number of tests upfront.
But Top-level await may soon offer an alternative for use cases where this feature would help with readability.

@jeysal jeysal closed this as completed Jul 13, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants