test: tighten qa and memory array assertions · openclaw/openclaw@e6755fd
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
File tree
qa-matrix/src/runners/contract
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,7 +122,7 @@ describe("anthropic cli migration", () => {
|
122 | 122 | }, |
123 | 123 | }); |
124 | 124 | |
125 | | -expect(result.profiles).toEqual([]); |
| 125 | +expect(result.profiles).toStrictEqual([]); |
126 | 126 | expect(result.defaultModel).toBe("anthropic/claude-opus-4-7"); |
127 | 127 | expect(result.configPatch).toEqual({ |
128 | 128 | agents: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -127,7 +127,7 @@ describe("anthropic provider policy public artifact", () => {
|
127 | 127 | if (!profile) { |
128 | 128 | throw new Error("Expected Anthropic policy profile"); |
129 | 129 | } |
130 | | -expect(collectLegacyExtendedLevelIds(profile.levels)).toEqual([]); |
| 130 | +expect(collectLegacyExtendedLevelIds(profile.levels)).toStrictEqual([]); |
131 | 131 | }); |
132 | 132 | |
133 | 133 | it("does not expose Anthropic thinking profiles for unrelated providers", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -481,7 +481,7 @@ cli note
|
481 | 481 | }); |
482 | 482 | expect(dryRun.dryRun).toBe(true); |
483 | 483 | expect(dryRun.createdCount).toBe(1); |
484 | | -await expect(fs.readdir(path.join(rootDir, "sources"))).resolves.toEqual([]); |
| 484 | +await expect(fs.readdir(path.join(rootDir, "sources"))).resolves.toStrictEqual([]); |
485 | 485 | |
486 | 486 | const applied = await runWikiChatGptImport({ |
487 | 487 | config, |
@@ -522,6 +522,6 @@ cli note
|
522 | 522 | fs |
523 | 523 | .readdir(path.join(rootDir, "sources")) |
524 | 524 | .then((entries) => entries.filter((entry) => entry !== "index.md")), |
525 | | -).resolves.toEqual([]); |
| 525 | +).resolves.toStrictEqual([]); |
526 | 526 | }); |
527 | 527 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -496,7 +496,7 @@ describe("compileMemoryWikiVault", () => {
|
496 | 496 | await compileMemoryWikiVault(config); |
497 | 497 | const second = await compileMemoryWikiVault(config); |
498 | 498 | |
499 | | -expect(second.updatedFiles).toEqual([]); |
| 499 | +expect(second.updatedFiles).toStrictEqual([]); |
500 | 500 | await expect(fs.readFile(path.join(rootDir, "entities", "beta.md"), "utf8")).resolves.toContain( |
501 | 501 | "[Gamma](concepts/gamma.md)", |
502 | 502 | ); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ describe("buildWikiPromptSection", () => {
|
29 | 29 | }); |
30 | 30 | |
31 | 31 | it("stays empty when no wiki or memory-adjacent tools are registered", () => { |
32 | | -expect(buildWikiPromptSection({ availableTools: new Set(["web_search"]) })).toEqual([]); |
| 32 | +expect(buildWikiPromptSection({ availableTools: new Set(["web_search"]) })).toStrictEqual([]); |
33 | 33 | }); |
34 | 34 | |
35 | 35 | it("can append a compact compiled digest snapshot when enabled", async () => { |
@@ -97,7 +97,7 @@ describe("buildWikiPromptSection", () => {
|
97 | 97 | }), |
98 | 98 | ); |
99 | 99 | |
100 | | -expect(builder({ availableTools: new Set(["web_search"]) })).toEqual([]); |
| 100 | +expect(builder({ availableTools: new Set(["web_search"]) })).toStrictEqual([]); |
101 | 101 | }); |
102 | 102 | |
103 | 103 | it("stabilizes digest prompt ordering for prompt-cache-friendly output", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -198,7 +198,7 @@ describe("qa agentic parity report", () => {
|
198 | 198 | const regressionFailures = comparison.failures.filter((failure) => |
199 | 199 | failure.includes("completion rate"), |
200 | 200 | ); |
201 | | -expect(regressionFailures).toEqual([]); |
| 201 | +expect(regressionFailures).toStrictEqual([]); |
202 | 202 | }); |
203 | 203 | |
204 | 204 | it("fails the parity gate when required parity scenarios are missing on both sides", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,7 @@ describe("qa coverage report", () => {
|
11 | 11 | expect(inventory.primaryCoverageIdCount).toBeGreaterThan(0); |
12 | 12 | expect(inventory.secondaryCoverageIdCount).toBeGreaterThan(0); |
13 | 13 | expect(inventory.overlappingCoverage.length).toBeGreaterThan(0); |
14 | | -expect(inventory.missingCoverage).toEqual([]); |
| 14 | +expect(inventory.missingCoverage).toStrictEqual([]); |
15 | 15 | expect(inventory.byTheme.memory.map((feature) => feature.id)).toContain("memory.recall"); |
16 | 16 | expect(inventory.bySurface.memory.map((feature) => feature.id)).toContain("memory.recall"); |
17 | 17 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -75,7 +75,7 @@ describe("buildQaRuntimeEnv", () => {
|
75 | 75 | }), |
76 | 76 | ).rejects.toThrow("node missing"); |
77 | 77 | |
78 | | -await expect(readdir(tempParent)).resolves.toEqual([]); |
| 78 | +await expect(readdir(tempParent)).resolves.toStrictEqual([]); |
79 | 79 | }); |
80 | 80 | |
81 | 81 | it("keeps the slow-reply QA opt-out enabled under fast mode", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -83,7 +83,7 @@ describe("qa multipass runtime", () => {
|
83 | 83 | }); |
84 | 84 | |
85 | 85 | expect(plan.outputDir).toBe(outputDir); |
86 | | -expect(plan.scenarioIds).toEqual([]); |
| 86 | +expect(plan.scenarioIds).toStrictEqual([]); |
87 | 87 | expect(plan.qaCommand).not.toContain("--scenario"); |
88 | 88 | expect(plan.guestOutputDir).toBe("/workspace/openclaw-host/.artifacts/qa-e2e/multipass-test"); |
89 | 89 | expect(plan.reportPath).toBe(path.join(outputDir, "qa-suite-report.md")); |
@@ -251,7 +251,7 @@ describe("qa multipass runtime", () => {
|
251 | 251 | const tempEntries = fs |
252 | 252 | .readdirSync(resolvePreferredOpenClawTmpDir()) |
253 | 253 | .filter((entry) => entry.startsWith(path.basename(expectedTransferDir))); |
254 | | -expect(tempEntries).toEqual([]); |
| 254 | +expect(tempEntries).toStrictEqual([]); |
255 | 255 | fs.rmSync(outputDir, { recursive: true, force: true }); |
256 | 256 | }); |
257 | 257 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -32,15 +32,15 @@ describe("qa scenario catalog", () => {
|
32 | 32 | pack.scenarios |
33 | 33 | .filter((scenario) => scenario.execution?.kind !== "flow") |
34 | 34 | .map((scenario) => scenario.id), |
35 | | -).toEqual([]); |
| 35 | +).toStrictEqual([]); |
36 | 36 | expect( |
37 | 37 | pack.scenarios.filter((scenario) => (scenario.execution.flow?.steps.length ?? 0) > 0), |
38 | | -).not.toEqual([]); |
| 38 | +).not.toStrictEqual([]); |
39 | 39 | expect( |
40 | 40 | pack.scenarios |
41 | 41 | .filter((scenario) => !(scenario.coverage?.primary.length ?? 0)) |
42 | 42 | .map((scenario) => scenario.id), |
43 | | -).toEqual([]); |
| 43 | +).toStrictEqual([]); |
44 | 44 | expect(readQaScenarioById("memory-recall").coverage?.primary).toContain("memory.recall"); |
45 | 45 | }); |
46 | 46 | |
@@ -53,7 +53,7 @@ describe("qa scenario catalog", () => {
|
53 | 53 | expect(scenarioIds).toContain("subagent-fanout-synthesis"); |
54 | 54 | expect( |
55 | 55 | QA_AGENTIC_PARITY_SCENARIO_IDS.filter((scenarioId) => !scenarioIds.includes(scenarioId)), |
56 | | -).toEqual([]); |
| 56 | +).toStrictEqual([]); |
57 | 57 | }); |
58 | 58 | |
59 | 59 | it("loads scenario-specific execution config from per-scenario markdown", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。