({includeLog} = {includeLog: false})
| 62 | |
| 63 | let logMethod; |
| 64 | export function patchConsoleMethods({includeLog} = {includeLog: false}) { |
| 65 | patchConsoleMethod('error', loggedErrors); |
| 66 | patchConsoleMethod('warn', loggedWarns); |
| 67 | |
| 68 | // Only assert console.log isn't called in CI so you can debug tests in DEV. |
| 69 | // The matchers will still work in DEV, so you can assert locally. |
| 70 | if (includeLog) { |
| 71 | logMethod = patchConsoleMethod('log', loggedLogs); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | export function resetAllUnexpectedConsoleCalls() { |
| 76 | loggedErrors.length = 0; |
no test coverage detected