I want to use jest for my server unit testing (instead of mocha+chai). Is there a way I can run async function before all tests start (init purposes) only once and not for every
jest provides options for both global setup and teardown in new versions. You can create files for both setup and teardown exporting an async function and provide that path in jest configurarion like this.
"globalSetup": "setup-file-path",
"globalTeardown": "tear-down-file-path"
You can read about it further here