test: avoid more filter allocation assertions · openclaw/openclaw@a899f81
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
File tree
mattermost/src/mattermost
| Original file line number | Diff line number | Diff line change |
|---|
@@ -112,7 +112,7 @@ describe("Mattermost model picker", () => {
|
112 | 112 | }); |
113 | 113 | |
114 | 114 | const ids = modelsView.buttons.flat().map((button) => button.id); |
115 | | -expect(ids.filter((id) => typeof id !== "string" || !/^[a-z0-9]+$/.test(id))).toEqual([]); |
| 115 | +expect(ids.every((id) => typeof id === "string" && /^[a-z0-9]+$/.test(id))).toBe(true); |
116 | 116 | expect(new Set(ids).size).toBe(ids.length); |
117 | 117 | }); |
118 | 118 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -129,7 +129,7 @@ describe("nvidia provider hooks", () => {
|
129 | 129 | "minimaxai/minimax-m2.5", |
130 | 130 | "z-ai/glm5", |
131 | 131 | ]); |
132 | | -expect(entries?.filter((entry) => entry.provider !== "nvidia")).toEqual([]); |
| 132 | +expect(entries?.every((entry) => entry.provider === "nvidia")).toBe(true); |
133 | 133 | }); |
134 | 134 | |
135 | 135 | it("opts into literal provider-prefix preservation", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ const repoRoot = path.resolve(import.meta.dirname, "..");
|
10 | 10 | type PluginNpmRuntimeBuildPlan = NonNullable<ReturnType<typeof resolvePluginNpmRuntimeBuildPlan>>; |
11 | 11 | |
12 | 12 | function expectDistRelativePaths(paths: string[]) { |
13 | | -expect(paths.filter((entry) => !entry.startsWith("./dist/"))).toEqual([]); |
| 13 | +expect(paths.every((entry) => entry.startsWith("./dist/"))).toBe(true); |
14 | 14 | } |
15 | 15 | |
16 | 16 | function expectPluginNpmRuntimeBuildPlan( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -71,7 +71,7 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
|
71 | 71 | const plan = createPluginPrereleaseTestPlan(); |
72 | 72 | |
73 | 73 | expect(plan.dockerLanes).not.toContain("openai-web-search-minimal"); |
74 | | -expect(plan.dockerLanes.filter((lane) => lane.startsWith("live-"))).toEqual([]); |
| 74 | +expect(plan.dockerLanes.some((lane) => lane.startsWith("live-"))).toBe(false); |
75 | 75 | expect(plan.staticChecks).toContainEqual({ |
76 | 76 | check: "live-ish-availability", |
77 | 77 | checkName: "checks-plugin-prerelease-live-ish-availability", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。