()
| 52 | } |
| 53 | |
| 54 | function failTestOnConsoleError() { |
| 55 | const error = console.error; |
| 56 | |
| 57 | console.error = function (message) { |
| 58 | const allowedPattern = |
| 59 | typeof message === 'string' && |
| 60 | ERROR_PATTERNS_WE_SHOULD_FIX_BUT_ALLOW.find(pattern => matchesPattern(message, pattern)); |
| 61 | if (allowedPattern) { |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | error.apply(console, arguments); |
| 66 | throw message instanceof Error ? message : new Error(message); |
| 67 | }; |
| 68 | } |
| 69 | |
| 70 | function failTestOnConsoleWarn() { |
| 71 | const warn = console.warn; |
no test coverage detected