mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:20:43 +00:00
test: clarify infra cleanup assertions
This commit is contained in:
@@ -189,13 +189,13 @@ describe("agent-events sequencing", () => {
|
||||
seen.push(evt.runId);
|
||||
});
|
||||
|
||||
expect(() =>
|
||||
expect(
|
||||
emitAgentEvent({
|
||||
runId: "run-safe",
|
||||
stream: "assistant",
|
||||
data: { text: "hi" },
|
||||
}),
|
||||
).not.toThrow();
|
||||
).toBeUndefined();
|
||||
|
||||
stopGood();
|
||||
stopBad();
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("channel runtime context helpers", () => {
|
||||
|
||||
const scoped = createTaskScopedChannelRuntime({});
|
||||
expect(scoped.channelRuntime).toBeUndefined();
|
||||
expect(() => scoped.dispose()).not.toThrow();
|
||||
expect(scoped.dispose()).toBeUndefined();
|
||||
});
|
||||
|
||||
it("disposes only task-scoped registrations", () => {
|
||||
|
||||
@@ -99,7 +99,7 @@ function expectCrossContextPolicyResult(params: {
|
||||
},
|
||||
});
|
||||
if (params.expected === "allow") {
|
||||
expect(run).not.toThrow();
|
||||
expect(run()).toBeUndefined();
|
||||
return;
|
||||
}
|
||||
expect(run).toThrow(params.expected);
|
||||
|
||||
@@ -40,10 +40,8 @@ describe("skills-remote", () => {
|
||||
|
||||
it("supports idempotent remote node removal", () => {
|
||||
const nodeId = `node-${randomUUID()}`;
|
||||
expect(() => {
|
||||
removeRemoteNodeInfo(nodeId);
|
||||
removeRemoteNodeInfo(nodeId);
|
||||
}).not.toThrow();
|
||||
expect(removeRemoteNodeInfo(nodeId)).toBeUndefined();
|
||||
expect(removeRemoteNodeInfo(nodeId)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("bumps the skills snapshot version when an eligible remote node disconnects", async () => {
|
||||
|
||||
@@ -111,7 +111,7 @@ describe("listChannelCatalogEntries", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(() => module.listChannelCatalogEntries({ env: ENV })).not.toThrow();
|
||||
expect(module.listChannelCatalogEntries({ env: ENV })).toEqual([]);
|
||||
|
||||
expect(loadRecordsSpy).toHaveBeenCalledTimes(1);
|
||||
expect(discoverSpy).toHaveBeenCalledTimes(1);
|
||||
|
||||
@@ -518,7 +518,7 @@ describe("stageBundledPluginRuntime", () => {
|
||||
return realSymlinkSync(String(target), linkPath, type);
|
||||
}) as typeof fs.symlinkSync);
|
||||
|
||||
expect(() => stageBundledPluginRuntime({ repoRoot })).not.toThrow();
|
||||
stageBundledPluginRuntime({ repoRoot });
|
||||
|
||||
const runtimeAssetPath = path.join(
|
||||
repoRoot,
|
||||
|
||||
Reference in New Issue
Block a user