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:
@@ -17,7 +17,17 @@ const mockContext = {
|
|||||||
abort: new AbortController().signal,
|
abort: new AbortController().signal,
|
||||||
metadata: () => {},
|
metadata: () => {},
|
||||||
ask: async () => {},
|
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 {
|
function createTask(overrides: Partial<BackgroundTask> = {}): BackgroundTask {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user