test: clarify infra cleanup assertions

This commit is contained in:
Peter Steinberger
2026-05-08 12:56:00 +01:00
parent 42c9bd59e7
commit a4764091ce
6 changed files with 8 additions and 10 deletions

View File

@@ -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();

View File

@@ -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", () => {

View File

@@ -99,7 +99,7 @@ function expectCrossContextPolicyResult(params: {
},
});
if (params.expected === "allow") {
expect(run).not.toThrow();
expect(run()).toBeUndefined();
return;
}
expect(run).toThrow(params.expected);

View File

@@ -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 () => {

View File

@@ -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);

View File

@@ -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,