

























@@ -1981,10 +1981,12 @@ describe("prepareSlackMessage sender prefix", () => {
1981198119821982const result = await prepareSenderPrefixMessage(ctx, "<@BOT> hello", "1700000000.0001");
198319831984-expect(result).not.toBeNull();
1985-const body = result?.ctxPayload.Body ?? "";
1984+if (!result) {
1985+throw new Error("expected Slack sender prefix message");
1986+}
1987+const body = result.ctxPayload.Body;
19861988expect(body).toContain("Alice (U1): <@BOT> (Bek) hello");
1987-expect(result?.ctxPayload.RawBody).toBe("<@BOT> (Bek) hello");
1989+expect(result.ctxPayload.RawBody).toBe("<@BOT> (Bek) hello");
19881990});
1989199119901992it("keeps raw Slack mention tokens when user lookup cannot resolve them", async () => {
@@ -1997,10 +1999,12 @@ describe("prepareSlackMessage sender prefix", () => {
1997199919982000const result = await prepareSenderPrefixMessage(ctx, "<@BOT> hello", "1700000000.0001");
199920012000-expect(result).not.toBeNull();
2001-const body = result?.ctxPayload.Body ?? "";
2002+if (!result) {
2003+throw new Error("expected Slack sender prefix message");
2004+}
2005+const body = result.ctxPayload.Body;
20022006expect(body).toContain("Alice (U1): <@BOT> hello");
2003-expect(result?.ctxPayload.RawBody).toBe("<@BOT> hello");
2007+expect(result.ctxPayload.RawBody).toBe("<@BOT> hello");
20042008});
2005200920062010it("caps Slack mention username lookups per inbound message and leaves overflow mentions raw", async () => {
@@ -2183,7 +2187,9 @@ describe("slack thread.requireExplicitMention", () => {
21832187 message,
21842188opts: { source: "message" },
21852189});
2186-expect(result).not.toBeNull();
2190+if (!result) {
2191+throw new Error("expected Slack thread reply message");
2192+}
21872193});
2188219421892195it("allows thread reply without explicit mention when requireExplicitMention is false (default)", async () => {
@@ -2210,6 +2216,8 @@ describe("slack thread.requireExplicitMention", () => {
22102216 message,
22112217opts: { source: "message" },
22122218});
2213-expect(result).not.toBeNull();
2219+if (!result) {
2220+throw new Error("expected Slack thread reply message");
2221+}
22142222});
22152223});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。