chore: Fix remaining extension test types, enable type checking for extension tests.

This commit is contained in:
cpojer
2026-02-17 10:12:49 +09:00
parent a741985574
commit d3a36cc3b0
10 changed files with 161 additions and 37 deletions

View File

@@ -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(() => {

View File

@@ -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");
});