@shopify/cli-kit
    Preparing search index...

    Function withCapturedStandardStreams

    • Runs a callback with process stdout/stderr captured and unit-test output suppression disabled, so tests can assert on what a command actually writes to the standard streams.

      The callback receives accessors instead of the function returning captured output so that assertions remain possible when the callback throws (for example commands that abort). Streams, console.warn and unit-test detection are restored afterwards. Not safe for concurrent tests.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

      The value returned by the callback.