Do you want to request a feature or report a bug?
feature
What is the current behavior?
Unable to execute some code only once before all test files, e. g. create a database, promisify functions, import reflect-metadata, etc.
What is the expected behavior?
Able to execute some before all test files.
beforeEach or using your own custom test environment will work. There is a PR to make that async, #4506.
@cpojer I can't find out how your response related to the issue.
@Deilan , I'm experiencing the same thing, is there any solution run beforeAll that runs only once even if im using multiple test files?
We have globalSetup these days: https://facebook.github.io/jest/docs/en/configuration.html#globalsetup-string
@SimenB is there an example of how globalSetup can be used?
@voroshkov see https://jestjs.io/docs/en/puppeteer
@thymikee, thanks! Is there a way I can use ES6 imports in the globalSetup script or in scripts it requires?
Nope, only with babel-register if you fancy
Most helpful comment
We have
globalSetupthese days: https://facebook.github.io/jest/docs/en/configuration.html#globalsetup-string