test(background-task): mock notification shell chain

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-06 11:10:55 +09:00
parent 2fd6be06c2
commit 786b06518a
@@ -17,7 +17,17 @@ const mockContext = {
abort: new AbortController().signal,
metadata: () => {},
ask: async () => {},
} as unknown as ToolContext
$: () => {
const result = { stdout: Buffer.from(""), stderr: Buffer.from(""), exitCode: 0 }
const promise = Promise.resolve(result) as Promise<typeof result> & {
quiet: () => Promise<typeof result>
nothrow: () => typeof promise
}
promise.quiet = () => promise
promise.nothrow = () => promise
return promise
},
} as ToolContext
function createTask(overrides: Partial<BackgroundTask> = {}): BackgroundTask {
return {