PokéRogue
    Preparing search index...

    The MockConsole is a wrapper around the global console object. It automatically colors text and such.

    Implements

    • Omit<Console, "Console">
    Index

    Constructors

    Properties

    console: Console = console

    The original Console object, preserved to avoid overwriting Vitest's native console.log wrapping.

    queuedWarnings: unknown[][] = []

    A list of warnings that are queued to be displayed after all tests in the same file are finished.

    Methods

    • The console.assert() static method writes an error message to the console if the assertion is false.

      MDN Reference

      Parameters

      • ...args: [value: any, message?: string, ...optionalParams: any[]]

      Returns void

    • Check whether a given set of data is in the blacklist to be barred from logging.

      Parameters

      • data: unknown[]

        The data being logged

      Returns boolean

      Whether data is blacklisted from console logging

    • Stringify the given data in a manner fit for logging.

      Parameters

      • color: undefined | ((s: unknown) => unknown)

        A Chalk instance or other transformation function used to transform the output, or undefined to not transform it at all.

      • data: unknown

        The data that the format should be applied to.

      Returns unknown[]

      A stringified copy of data with color applied to each individual argument.

      Do we need to apply color to each entry or just run it through util.format?

    • The console.group() static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.

      MDN Reference

      Parameters

      • ...args: any[]

      Returns void

    • This method does not display anything unless used in the inspector. The console.profile() method starts a JavaScript CPU profile with an optional label until profileEnd is called. The profile is then added to the Profile panel of the inspector.

      console.profile('MyLabel');
      // Some code
      console.profileEnd('MyLabel');
      // Adds the profile 'MyLabel' to the Profiles panel of the inspector.

      Parameters

      • ...args: [label?: string]

      Returns void

      v8.0.0

    • This method does not display anything unless used in the inspector. Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. See profile for an example.

      If this method is called without a label, the most recently started profile is stopped.

      Parameters

      • ...args: [label?: string]

      Returns void

      v8.0.0

    • The console.timeLog() static method logs the current value of a timer that was previously started by calling console/time_static.

      MDN Reference

      Parameters

      • ...args: [label?: string, ...data: any[]]

      Returns void