-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Docs]: Difference between runner and testRunner? #14932
Comments
You can look at Jest like a sort task orchestrator. Runner then is what it manages (you can use this to e.g. run ESLint via Jest). A runner is executed once for every top level invocation (or watch mode re-run). Test runner is used by Jest's builtin runner in order to run tests. The test runner is then either Does that make sense? Happy to take PRs to clarify the docs |
by top-level invocation, you mean when you run the Jest CLI right? I'll submit a clarification PR |
Which abstraction would help me set some context right before an individual Update: Found #7774 . What i really wanted was the test name so this should work I believe. If I have any other dynamic metadata (like some uuid I want to generate per test) I'll try the custom testRunner approach. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Page(s)
https://jestjs.io/docs/configuration#runner-string
Description
Can you explain the difference between a runner and testRunner?
It seems a runner is what runs all the test runners no? From my own tinkering, testRunners got called once per test file, while a runner only gets called once with all tests across all files.
The text was updated successfully, but these errors were encountered: