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

*Feature request - allow global async initializer #2548

Closed
shai32 opened this issue Jun 16, 2017 · 5 comments
Closed

*Feature request - allow global async initializer #2548

shai32 opened this issue Jun 16, 2017 · 5 comments

Comments

@shai32
Copy link

shai32 commented Jun 16, 2017

feature request - allow global async initializer

What is the current behavior?

setupFiles and setupTestFrameworkScriptFile, are running before each test (as it say in the docs)
also there is no way to wait for an async initializer

What is the expected behavior?

  1. support a setupFile that export a promise.
  2. the tests will run only after the promise is resolved
  3. the promise will be run only once before any test will run.
@shai32
Copy link
Author

shai32 commented Jun 16, 2017

I am running all my test with webStorm jest integration, so creating my own script that initialize and then run the test will fall with webStorm integration

@heyimalex
Copy link
Contributor

This is more for jest than cra I think. See the response here.

@shai32
Copy link
Author

shai32 commented Jun 17, 2017

The solution in there will make the async initializer to be run for each test.
I need it to be run once, before any tests.

@shai32 shai32 changed the title *Feature request - allow global async initlaize *Feature request - allow global async initializer Jun 17, 2017
@shai32
Copy link
Author

shai32 commented Jun 19, 2017

how do you deal with async initializer like db initialisation?

@gaearon
Copy link
Contributor

gaearon commented Jun 22, 2017

You have already created two issues about this:

#2539
#2464

Let's discuss in the first one. Please don't create any more duplicate issues. Thanks.

@gaearon gaearon closed this as completed Jun 22, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants