Home / Function/ patchConsoleMethods() — react Function Reference

patchConsoleMethods() — react Function Reference

Architecture documentation for the patchConsoleMethods() function in consoleMock.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d20ba1b0_60b0_96ce_d960_536391cbe776["patchConsoleMethods()"]
  9565063b_3ea2_9cbf_86d6_3ee1e66bf4cc["consoleMock.js"]
  d20ba1b0_60b0_96ce_d960_536391cbe776 -->|defined in| 9565063b_3ea2_9cbf_86d6_3ee1e66bf4cc
  3c5e3b88_b4d6_1d09_2f08_eec4c3a52d52["patchConsoleMethod()"]
  d20ba1b0_60b0_96ce_d960_536391cbe776 -->|calls| 3c5e3b88_b4d6_1d09_2f08_eec4c3a52d52
  style d20ba1b0_60b0_96ce_d960_536391cbe776 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/internal-test-utils/consoleMock.js lines 64–73

export function patchConsoleMethods({includeLog} = {includeLog: false}) {
  patchConsoleMethod('error', loggedErrors);
  patchConsoleMethod('warn', loggedWarns);

  // Only assert console.log isn't called in CI so you can debug tests in DEV.
  // The matchers will still work in DEV, so you can assert locally.
  if (includeLog) {
    logMethod = patchConsoleMethod('log', loggedLogs);
  }
}

Domain

Subdomains

Frequently Asked Questions

What does patchConsoleMethods() do?
patchConsoleMethods() is a function in the react codebase, defined in packages/internal-test-utils/consoleMock.js.
Where is patchConsoleMethods() defined?
patchConsoleMethods() is defined in packages/internal-test-utils/consoleMock.js at line 64.
What does patchConsoleMethods() call?
patchConsoleMethods() calls 1 function(s): patchConsoleMethod.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free