fix: correct spawn mock type in session-notification test

This commit is contained in:
YeonGyu-Kim
2026-01-07 01:43:03 +09:00
parent ad44af9d15
commit 2064568124

View File

@@ -27,7 +27,7 @@ describe("session-notification", () => {
// Mock spawn to track notification commands // Mock spawn to track notification commands
// Uses node:child_process.spawn instead of Bun shell to avoid GC crash // Uses node:child_process.spawn instead of Bun shell to avoid GC crash
spawnMock = spyOn(childProcess, "spawn").mockImplementation((cmd: string, args?: string[]) => { spawnMock = spyOn(childProcess, "spawn").mockImplementation(((cmd: string, args?: string[]) => {
// Track notification commands (osascript, notify-send, powershell) // Track notification commands (osascript, notify-send, powershell)
if (cmd.includes("osascript") || cmd.includes("notify-send") || cmd.includes("powershell")) { if (cmd.includes("osascript") || cmd.includes("notify-send") || cmd.includes("powershell")) {
notificationCalls.push(`${cmd} ${(args ?? []).join(" ")}`) notificationCalls.push(`${cmd} ${(args ?? []).join(" ")}`)
@@ -35,7 +35,7 @@ describe("session-notification", () => {
const emitter = new EventEmitter() const emitter = new EventEmitter()
setTimeout(() => emitter.emit("close", 0), 0) setTimeout(() => emitter.emit("close", 0), 0)
return emitter as any return emitter as any
}) }) as typeof childProcess.spawn)
spyOn(utils, "getOsascriptPath").mockResolvedValue("/usr/bin/osascript") spyOn(utils, "getOsascriptPath").mockResolvedValue("/usr/bin/osascript")
spyOn(utils, "getNotifySendPath").mockResolvedValue("/usr/bin/notify-send") spyOn(utils, "getNotifySendPath").mockResolvedValue("/usr/bin/notify-send")