File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const utils = require ( '../utils' ) ;
4
4
5
- if ( typeof jest !== 'undefined' && typeof window !== 'undefined' ) {
6
- utils . warn ( 'Mongoose: looks like you\'re trying to test a Mongoose app ' +
7
- 'with Jest\'s default jsdom test environment. Please make sure you read ' +
8
- 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' +
9
- 'https://mongoosejs.com/docs/jest.html' ) ;
10
- }
5
+ if ( typeof jest !== 'undefined' && ! process . env . SUPPRESS_JEST_WARNINGS ) {
6
+ if ( typeof window !== 'undefined' ) {
7
+ utils . warn ( 'Mongoose: looks like you\'re trying to test a Mongoose app ' +
8
+ 'with Jest\'s default jsdom test environment. Please make sure you read ' +
9
+ 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' +
10
+ 'https://mongoosejs.com/docs/jest.html' ) ;
11
+ }
11
12
12
- if ( typeof jest !== 'undefined' && setTimeout . clock != null && typeof setTimeout . clock . Date === 'function' ) {
13
- utils . warn ( 'Mongoose: looks like you\'re trying to test a Mongoose app ' +
14
- 'with Jest\'s mock timers enabled. Please make sure you read ' +
15
- 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' +
16
- 'https://mongoosejs.com/docs/jest.html' ) ;
13
+ if ( setTimeout . clock != null && typeof setTimeout . clock . Date === 'function' ) {
14
+ utils . warn ( 'Mongoose: looks like you\'re trying to test a Mongoose app ' +
15
+ 'with Jest\'s mock timers enabled. Please make sure you read ' +
16
+ 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' +
17
+ 'https://mongoosejs.com/docs/jest.html' ) ;
18
+ }
17
19
}
You can’t perform that action at this time.
0 commit comments