wix-incubator / jest-metadata

🦸‍♂️ Superhero power for your Jest reporters! 🦸‍♀️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarify async-await fllow between test environment handler and reporter

noomorph opened this issue · comments

It's unclear what relationship is between Jest Circus handler and reporter. Do they block each other or not? And who runs when....

So, I've checked this:

LaggyEnvironment handleTestEvent test_done...
LaggyEnvironment handleTestEvent test_done done
Entered onTestCaseResult
Lagging onTestCaseResult...
LaggyEnvironment handleTestEvent test_start...
LaggyEnvironment handleTestEvent test_start done
LaggyEnvironment handleTestEvent hook_start...
Lagging onTestCaseResult done
LaggyEnvironment handleTestEvent hook_start done

Turns out, that reporter waits for environment, while environment does not wait for the reporter.