MCPcopy
hub / github.com/facebook/react / patchConsoleMethods

Function patchConsoleMethods

packages/internal-test-utils/consoleMock.js:64–73  ·  view source on GitHub ↗
({includeLog} = {includeLog: false})

Source from the content-addressed store, hash-verified

62
63let logMethod;
64export 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
75export function resetAllUnexpectedConsoleCalls() {
76 loggedErrors.length = 0;

Callers 3

setupTests.jsFile · 0.85
setupTests.jsFile · 0.85

Calls 1

patchConsoleMethodFunction · 0.85

Tested by

no test coverage detected