Skip to content
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]: Unknown option "coverageReporters" validation warning when used for projects #14701

Closed
Kirdock opened this issue Nov 17, 2023 · 5 comments · Fixed by #14830
Closed

[Bug]: Unknown option "coverageReporters" validation warning when used for projects #14701

Kirdock opened this issue Nov 17, 2023 · 5 comments · Fixed by #14830

Comments

@Kirdock
Copy link

Kirdock commented Nov 17, 2023

Version

29.7.0

Steps to reproduce

It's as the same as for the issue #14513, just for coverageReporters

Expected behavior

No warnings are shown

Actual behavior

Warnings are shown

● Validation Warning:

  Unknown option "coverageReporters" with value ["text", "cobertura"] was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.22621
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13950HX
  Binaries:
    Node: 18.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: 29.7.0 => 29.7.0
Copy link

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.

@github-actions github-actions bot added the Stale label Dec 17, 2023
@nbolton
Copy link

nbolton commented Jan 4, 2024

As a workaround, I created the following patch with patch-package:

patches/jest-validate+29.7.0.patch:

diff --git a/node_modules/jest-validate/build/warnings.js b/node_modules/jest-validate/build/warnings.js
index 1860d5a..aef7d81 100644
--- a/node_modules/jest-validate/build/warnings.js
+++ b/node_modules/jest-validate/build/warnings.js
@@ -23,6 +23,13 @@ function _interopRequireDefault(obj) {
  */
 
 const unknownOptionWarning = (config, exampleConfig, option, options, path) => {
+  // HACK: do not warn about coverageReporters and reporters.
+  // they are actually valid options, but are being reported as invalid.
+  if (option === "coverageReporters" || option === "reporters") {
+    return;
+  }
   const didYouMean = (0, _utils.createDidYouMeanMessage)(
     option,
     Object.keys(exampleConfig)

@github-actions github-actions bot removed the Stale label Jan 4, 2024
@SimenB
Copy link
Member

SimenB commented Jan 4, 2024

Happy to take a PR fixing this. It should be a matter of adding the two options to https://github.com/jestjs/jest/blob/acc803a1ad4914cfcc77db5cd13e672db93a985b/packages/jest-config/src/ValidConfig.ts

FWIW, this is a duplicate of #13576, so closing. But again, PR welcome! 🙂

@SimenB SimenB closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
Copy link

github-actions bot commented Feb 5, 2024

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
@SimenB
Copy link
Member

SimenB commented Feb 20, 2024

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants