mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 06:57:26 +00:00
chore: Fix remaining extension test types, enable type checking for extension tests.
This commit is contained in:
@@ -16,7 +16,10 @@ function createWebhookRequest(params: {
|
||||
payload: unknown;
|
||||
path?: string;
|
||||
}): IncomingMessage {
|
||||
const req = new EventEmitter() as IncomingMessage & { destroyed?: boolean; destroy: () => void };
|
||||
const req = new EventEmitter() as IncomingMessage & {
|
||||
destroyed?: boolean;
|
||||
destroy: (error?: Error) => IncomingMessage;
|
||||
};
|
||||
req.method = "POST";
|
||||
req.url = params.path ?? "/googlechat";
|
||||
req.headers = {
|
||||
@@ -26,6 +29,7 @@ function createWebhookRequest(params: {
|
||||
req.destroyed = false;
|
||||
req.destroy = () => {
|
||||
req.destroyed = true;
|
||||
return req;
|
||||
};
|
||||
|
||||
void Promise.resolve().then(() => {
|
||||
|
||||
@@ -79,6 +79,9 @@ describe("googlechat resolveTarget", () => {
|
||||
});
|
||||
|
||||
expect(result.ok).toBe(true);
|
||||
if (!result.ok) {
|
||||
throw result.error;
|
||||
}
|
||||
expect(result.to).toBe("spaces/AAA");
|
||||
});
|
||||
|
||||
@@ -90,6 +93,9 @@ describe("googlechat resolveTarget", () => {
|
||||
});
|
||||
|
||||
expect(result.ok).toBe(true);
|
||||
if (!result.ok) {
|
||||
throw result.error;
|
||||
}
|
||||
expect(result.to).toBe("users/user@example.com");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user