Creates a fake CockpitProcess that emits data chunks then resolves (or rejects).
CockpitProcess
data
One or more output chunks delivered via the stream callback.
stream
Optional
When provided, the process rejects with this message instead of resolving.
vi.spyOn(cockpit, "spawn").mockReturnValue(mockProcess("hello\nworld\n")); Copy
vi.spyOn(cockpit, "spawn").mockReturnValue(mockProcess("hello\nworld\n"));
Creates a fake
CockpitProcessthat emitsdatachunks then resolves (or rejects).