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

Add config to disable Jest warnings #13373

Closed
2 tasks done
thernstig opened this issue May 3, 2023 · 2 comments
Closed
2 tasks done

Add config to disable Jest warnings #13373

thernstig opened this issue May 3, 2023 · 2 comments
Labels
developer-experience This issue improves error messages, debugging, or reporting
Milestone

Comments

@thernstig
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

We have been using Mongoose + Jest + Jest fake timers for a very long time without any problem. If you know what you are doing, this is entirely possible.

Yet we get all warnings printed from https://github.com/Automattic/mongoose/blob/master/lib/helpers/printJestWarning.js e.g.:

(node:1393585) [MONGOOSE] Warning: Mongoose: looks like you're trying to test a Mongoose app with Jest's mock timers enabled. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html

It would be very nice to be able to disable this message. It is quite intrusive in the many printouts happening when you have a lot of unit test files.

Motivation

Allow users who know what they are doing to disable Jest warnings.

Example

No response

@thernstig thernstig added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature new feature This change adds new functionality, like a new method or class labels May 3, 2023
@vkarpov15
Copy link
Collaborator

Reasonable enough. Are you on Mongoose 6.x or 7.x?

@vkarpov15 vkarpov15 added this to the 7.1.1 milestone May 4, 2023
@vkarpov15 vkarpov15 added developer-experience This issue improves error messages, debugging, or reporting and removed new feature This change adds new functionality, like a new method or class enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature labels May 4, 2023
@vkarpov15 vkarpov15 modified the milestones: 7.1.1, 7.1.2 May 4, 2023
@thernstig
Copy link
Author

We are using 6.x, but I am fine if you do this only in 7.x and we can focus on upgrading instead. Thank you for the great project!

@vkarpov15 vkarpov15 modified the milestones: 7.1.2, 6.11.1 May 6, 2023
vkarpov15 added a commit that referenced this issue May 8, 2023
Add SUPPRESS_JEST_WARNINGS environment variable to hide jest warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience This issue improves error messages, debugging, or reporting
Projects
None yet
Development

No branches or pull requests

2 participants