/**
 * Mock for node:child_process
 *
 * Provides mock spawn functions for testing
 */

import { vi } from "vitest";

export const spawn = vi.fn().mockReturnValue({
	unref: vi.fn(),
	pid: 12345,
	on: vi.fn(),
	stderr: { on: vi.fn() },
	stdout: { on: vi.fn() },
	kill: vi.fn(),
});

export const exec = vi.fn().mockImplementation((_cmd, callback) => {
	if (callback) {
		callback(null, "", "");
	}
});

export const execSync = vi.fn().mockReturnValue("");
