fix(ci): repair main checks

This commit is contained in:
Vincent Koc
2026-03-22 18:12:49 -07:00
parent 25f05612ee
commit cbf9cd0acb
11 changed files with 84 additions and 47 deletions

View File

@@ -77,6 +77,9 @@ describe("googlechat message actions", () => {
messageName: "spaces/AAA/messages/msg-1",
});
if (!googlechatMessageActions.handleAction) {
throw new Error("Expected googlechatMessageActions.handleAction to be defined");
}
const result = await googlechatMessageActions.handleAction({
action: "send",
params: {
@@ -140,6 +143,9 @@ describe("googlechat message actions", () => {
},
]);
if (!googlechatMessageActions.handleAction) {
throw new Error("Expected googlechatMessageActions.handleAction to be defined");
}
const result = await googlechatMessageActions.handleAction({
action: "react",
params: {

View File

@@ -32,23 +32,32 @@ function createResponse() {
statusCode: 0,
headers: {} as Record<string, string>,
body: "",
setHeader(name: string, value: string) {
this.headers[name] = value;
setHeader: (name: string, value: string) => {
res.headers[name] = value;
},
end(payload?: string) {
this.body = payload ?? "";
return this;
end: (payload?: string) => {
res.body = payload ?? "";
return res;
},
} as unknown as ServerResponse & {
headers: Record<string, string>;
body: string;
};
} as ServerResponse & { headers: Record<string, string>; body: string };
return res;
}
function installSimplePipeline(targets: unknown[]) {
withResolvedWebhookRequestPipeline.mockImplementation(
async ({ handle, req, res }: Record<string, unknown>) =>
async ({
handle,
req,
res,
}: {
handle: (input: {
targets: unknown[];
req: IncomingMessage;
res: ServerResponse;
}) => Promise<unknown>;
req: IncomingMessage;
res: ServerResponse;
}) =>
await handle({
targets,
req,

View File

@@ -4,6 +4,9 @@ import { googlechatSetupAdapter } from "./setup-core.js";
describe("googlechat setup core", () => {
it("rejects env auth for non-default accounts", () => {
if (!googlechatSetupAdapter.validateInput) {
throw new Error("Expected googlechatSetupAdapter.validateInput to be defined");
}
expect(
googlechatSetupAdapter.validateInput({
accountId: "secondary",
@@ -13,6 +16,9 @@ describe("googlechat setup core", () => {
});
it("requires inline or file credentials when env auth is not used", () => {
if (!googlechatSetupAdapter.validateInput) {
throw new Error("Expected googlechatSetupAdapter.validateInput to be defined");
}
expect(
googlechatSetupAdapter.validateInput({
accountId: DEFAULT_ACCOUNT_ID,
@@ -22,6 +28,9 @@ describe("googlechat setup core", () => {
});
it("builds a patch from token-file and trims optional webhook fields", () => {
if (!googlechatSetupAdapter.applyAccountConfig) {
throw new Error("Expected googlechatSetupAdapter.applyAccountConfig to be defined");
}
expect(
googlechatSetupAdapter.applyAccountConfig({
cfg: { channels: { googlechat: {} } },
@@ -51,6 +60,9 @@ describe("googlechat setup core", () => {
});
it("prefers inline token patch when token-file is absent", () => {
if (!googlechatSetupAdapter.applyAccountConfig) {
throw new Error("Expected googlechatSetupAdapter.applyAccountConfig to be defined");
}
expect(
googlechatSetupAdapter.applyAccountConfig({
cfg: { channels: { googlechat: {} } },