




















@@ -8,17 +8,17 @@ describe("command-analysis lazy command explainer", () => {
88it("does not load tree-sitter parser dependencies for policy summaries", async () => {
99const { resolveCommandAnalysisSummaryForDisplay } = await import("./explain.js");
101011-expect(
12-resolveCommandAnalysisSummaryForDisplay({
13- host: "gateway",
14- commandText: "python3 -c 'print(1)'",
15- }),
16-).toEqual(
17- expect.objectContaining({
18- commandCount: 1,
19- riskKinds: ["inline-eval"],
20- warningLines: ["Contains inline-eval: python3 -c"],
21- }),
22-);
11+const summary = resolveCommandAnalysisSummaryForDisplay({
12+host: "gateway",
13+commandText: "python3 -c 'print(1)'",
14+});
15+16+expect(summary).not.toBeNull();
17+if (!summary) {
18+throw new Error("expected command analysis summary");
19+}
20+expect(summary.commandCount).toBe(1);
21+expect(summary.riskKinds).toEqual(["inline-eval"]);
22+expect(summary.warningLines).toEqual(["Contains inline-eval: python3 -c"]);
2323});
2424});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。