printJestWarning.js 922 B

123456789101112131415161718192021
  1. 'use strict';
  2. const utils = require('../utils');
  3. if (typeof jest !== 'undefined' && !process.env.SUPPRESS_JEST_WARNINGS) {
  4. if (typeof window !== 'undefined') {
  5. utils.warn('Mongoose: looks like you\'re trying to test a Mongoose app ' +
  6. 'with Jest\'s default jsdom test environment. Please make sure you read ' +
  7. 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' +
  8. 'https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true ' +
  9. 'to hide this warning.');
  10. }
  11. if (typeof setTimeout.clock?.Date === 'function') {
  12. utils.warn('Mongoose: looks like you\'re trying to test a Mongoose app ' +
  13. 'with Jest\'s mock timers enabled. Please make sure you read ' +
  14. 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' +
  15. 'https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true ' +
  16. 'to hide this warning.');
  17. }
  18. }