cockpit-plugin-base-react - v1.1.1
    Preparing search index...

    Function mockProcess

    • Creates a fake CockpitProcess that emits data chunks then resolves (or rejects).

      Parameters

      • data: string | string[]

        One or more output chunks delivered via the stream callback.

      • Optionalerror: string

        When provided, the process rejects with this message instead of resolving.

      Returns CockpitProcess

      vi.spyOn(cockpit, "spawn").mockReturnValue(mockProcess("hello\nworld\n"));