fix(api): require api server callbacks
This commit is contained in:
1 parent
529bb109db
commit
5155136937
9 files changed
+103
-59
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import type { ApiServerEventCallbacks } from "../../src/main/api-server";
|
||||
|
||||
export function createTestApiServerCallbacks(
|
||||
overrides: Partial<ApiServerEventCallbacks> = {},
|
||||
): ApiServerEventCallbacks {
|
||||
return {
|
||||
onDomainChanged: () => {},
|
||||
onWakeAgent: () => null,
|
||||
onTaskCreated: () => {},
|
||||
onTaskStatusChanged: () => {},
|
||||
onCommentPosted: () => {},
|
||||
onApprovalCreated: () => {},
|
||||
onApprovalResolved: () => {},
|
||||
createDocument: () => {
|
||||
throw new Error("createDocument test callback was not provided.");
|
||||
},
|
||||
onAutoAssignTask: () => null,
|
||||
onHumanMessage: () => {},
|
||||
injectRuntimeMessage: () => false,
|
||||
emitEvent: () => {},
|
||||
notify: () => {},
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user