test: clarify infra cleanup assertions · openclaw/openclaw@a476409
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -189,13 +189,13 @@ describe("agent-events sequencing", () => {
|
189 | 189 | seen.push(evt.runId); |
190 | 190 | }); |
191 | 191 | |
192 | | -expect(() => |
| 192 | +expect( |
193 | 193 | emitAgentEvent({ |
194 | 194 | runId: "run-safe", |
195 | 195 | stream: "assistant", |
196 | 196 | data: { text: "hi" }, |
197 | 197 | }), |
198 | | -).not.toThrow(); |
| 198 | +).toBeUndefined(); |
199 | 199 | |
200 | 200 | stopGood(); |
201 | 201 | stopBad(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -35,7 +35,7 @@ describe("channel runtime context helpers", () => {
|
35 | 35 | |
36 | 36 | const scoped = createTaskScopedChannelRuntime({}); |
37 | 37 | expect(scoped.channelRuntime).toBeUndefined(); |
38 | | -expect(() => scoped.dispose()).not.toThrow(); |
| 38 | +expect(scoped.dispose()).toBeUndefined(); |
39 | 39 | }); |
40 | 40 | |
41 | 41 | it("disposes only task-scoped registrations", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -99,7 +99,7 @@ function expectCrossContextPolicyResult(params: {
|
99 | 99 | }, |
100 | 100 | }); |
101 | 101 | if (params.expected === "allow") { |
102 | | -expect(run).not.toThrow(); |
| 102 | +expect(run()).toBeUndefined(); |
103 | 103 | return; |
104 | 104 | } |
105 | 105 | expect(run).toThrow(params.expected); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,10 +40,8 @@ describe("skills-remote", () => {
|
40 | 40 | |
41 | 41 | it("supports idempotent remote node removal", () => { |
42 | 42 | const nodeId = `node-${randomUUID()}`; |
43 | | -expect(() => { |
44 | | -removeRemoteNodeInfo(nodeId); |
45 | | -removeRemoteNodeInfo(nodeId); |
46 | | -}).not.toThrow(); |
| 43 | +expect(removeRemoteNodeInfo(nodeId)).toBeUndefined(); |
| 44 | +expect(removeRemoteNodeInfo(nodeId)).toBeUndefined(); |
47 | 45 | }); |
48 | 46 | |
49 | 47 | it("bumps the skills snapshot version when an eligible remote node disconnects", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -111,7 +111,7 @@ describe("listChannelCatalogEntries", () => {
|
111 | 111 | }, |
112 | 112 | }); |
113 | 113 | |
114 | | -expect(() => module.listChannelCatalogEntries({ env: ENV })).not.toThrow(); |
| 114 | +expect(module.listChannelCatalogEntries({ env: ENV })).toEqual([]); |
115 | 115 | |
116 | 116 | expect(loadRecordsSpy).toHaveBeenCalledTimes(1); |
117 | 117 | expect(discoverSpy).toHaveBeenCalledTimes(1); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -518,7 +518,7 @@ describe("stageBundledPluginRuntime", () => {
|
518 | 518 | return realSymlinkSync(String(target), linkPath, type); |
519 | 519 | }) as typeof fs.symlinkSync); |
520 | 520 | |
521 | | -expect(() => stageBundledPluginRuntime({ repoRoot })).not.toThrow(); |
| 521 | +stageBundledPluginRuntime({ repoRoot }); |
522 | 522 | |
523 | 523 | const runtimeAssetPath = path.join( |
524 | 524 | repoRoot, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。