

























@@ -246,25 +246,25 @@ function expectCallConfigGatewayAuthToken(
246246mock: { mock: { calls: Array<Array<unknown>> } },
247247expected: string,
248248) {
249-const matched = mock.mock.calls.some(([value]) => {
249+const matchingCalls = mock.mock.calls.filter(([value]) => {
250250const options = value && typeof value === "object" ? (value as Record<string, unknown>) : {};
251251return readGatewayAuthToken(options.config) === expected;
252252});
253-expect(matched).toBe(true);
253+expect(matchingCalls).not.toEqual([]);
254254}
255255256256function expectNoteContaining(messagePart: string, title: string) {
257257const messages = mocks.note.mock.calls
258258.filter(([, callTitle]) => callTitle === title)
259259.map(([message]) => String(message));
260-expect(messages.some((message) => message.includes(messagePart))).toBe(true);
260+expect(messages.join("\n")).toContain(messagePart);
261261}
262262263263function expectNoNoteContaining(messagePart: string, title: string) {
264264const messages = mocks.note.mock.calls
265265.filter(([, callTitle]) => callTitle === title)
266266.map(([message]) => String(message));
267-expect(messages.some((message) => message.includes(messagePart))).toBe(false);
267+expect(messages.join("\n")).not.toContain(messagePart);
268268}
269269270270function setupGatewayEntrypointRepairScenario(params: {
@@ -402,12 +402,10 @@ describe("maybeRepairGatewayServiceConfig", () => {
402402const runtimeNotes = mocks.note.mock.calls.filter(([, title]) => title === "Gateway runtime");
403403const runtimeMessages = runtimeNotes.map(([message]) => message);
404404expect(runtimeMessages).not.toContain("duplicate doctor runtime warning");
405-expect(runtimeMessages.some((message) => String(message).includes("not found"))).toBe(false);
406-expect(
407-runtimeMessages.some((message) =>
408-String(message).includes("Using /home/orin/.nvm/versions/node/v22.22.2/bin/node"),
409-),
410-).toBe(true);
405+expect(runtimeMessages.map((message) => String(message)).join("\n")).not.toContain("not found");
406+expect(runtimeMessages.map((message) => String(message)).join("\n")).toContain(
407+"Using /home/orin/.nvm/versions/node/v22.22.2/bin/node",
408+);
411409});
412410413411it("passes planned managed env keys into service audit for legacy inline secret detection", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。