-
-
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
[Bug]: Reporter interface typing is too strong? #14427
Comments
They're all optional in reality, so PR very much welcome 🙂 jest/packages/jest-reporters/src/types.ts Lines 22 to 56 in eb61702
|
Even onRunComplete? The docs say: "Custom reporter module must export a class that takes globalConfig, reporterOptions and reporterContext as constructor arguments and implements at least onRunComplete() method"
Sure! I can do one for the docs too if they're not accurate |
Hooks of the reporters are called here: jest/packages/jest-core/src/ReporterDispatcher.ts. Looks like all are optional. Just as Simen said already. |
yes please 😀 |
Hi, Is someone already creating a PR? |
Typings got fixed. It would be useful to amend documentation as well. |
@mrazauskas I can contribute but is it documentation for the hook? |
@quantumflo Thanks for your interested! I took a better look at the problem and understood that the change is more involved than I thought initially. It was faster to open a PR (see #14435) than to explain the intention. |
@quantumflo Thanks for picking this up, I was on holiday last week 😎 |
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. |
Version
29.6.2
Steps to reproduce
onRunComplete
, as documented here: https://jestjs.io/docs/configuration/#custom-reporters.implement Reporter
(see https://codesandbox.io/s/sharp-babbage-6v54kc?file=/src/index.ts for example)Expected behavior
No TypeScript errors
Actual behavior
TypeScript error:
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: