()
| 60 | } |
| 61 | |
| 62 | function failTestOnConsoleWarn() { |
| 63 | const warn = console.warn; |
| 64 | |
| 65 | console.warn = function (message) { |
| 66 | const allowedPattern = |
| 67 | typeof message === 'string' && |
| 68 | WARNING_PATTERNS_WE_SHOULD_FIX_BUT_ALLOW.find(pattern => message.indexOf(pattern) > -1); |
| 69 | |
| 70 | if (allowedPattern) { |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | warn.apply(console, arguments); |
| 75 | throw message instanceof Error ? message : new Error(message); |
| 76 | }; |
| 77 | } |
| 78 | |
| 79 | expect.extend({ |
| 80 | toContainObject(received, argument) { |