Files
reverse-engineering-anything/tests/boundary/providers/auxiliaryDeclarations.test.ts
T
morluto 7bcefead69 test: strengthen and prune audited test coverage (#8573)
* test: strengthen and prune audited test coverage

* test: require delivered DeepSeek skill instructions

* test: keep schema fixture types private

* test: verify Gemini receives skill instructions

* test: bind Qwen skill evidence to its tool result

* test: report NativeAOT verifier checks precisely

* fix: verify Ghidra cleanup paths reliably

* fix: verify Command Code skill activation

* test: tighten cleanup and fixture checks

* test: verify packet capture evidence is recorded

* fix: report HTTP3 capture provenance accurately

* test: preserve resource coverage through MCP

* test: prune repeated assertions and retain cancellation identity

* fix: validate client verifier fixture paths

* test: skip Copilot verifier cases on Windows

* test: keep verifier setup target relative
2026-11-02 02:13:32 +08:00

44 lines
1.6 KiB
TypeScript

import { expect, it } from "vitest";
import { auxiliaryAnalysisProviderDeclarations } from "../../../src/composition/auxiliaryAnalysisProviders.js";
import { LazyAnalysisProvider } from "../../../src/application/binary/LazyAnalysisProvider.js";
import { parseBinaryTarget } from "../../../src/application/BinaryTargetResolver.js";
it("keeps declaration discovery and client creation lazy and independently owned", async () => {
const target = await parseBinaryTarget(process.execPath);
if (!target.ok) throw target.error;
const declarations = auxiliaryAnalysisProviderDeclarations({});
expect(declarations.map(({ identity }) => identity.id).sort()).toEqual([
"native-macos",
"rea-artifact-graph",
"rea-dotnet-static",
]);
for (const declaration of declarations) {
let loads = 0;
const provider = new LazyAnalysisProvider({
...declaration,
load: async () => {
loads += 1;
return declaration.load();
},
});
expect(provider.identity()).toEqual(declaration.identity);
expect(provider.capabilities()).toEqual(declaration.capabilities);
const client = provider.createClient(target.value);
const unusedClient = provider.createClient(target.value);
await unusedClient.close();
expect(loads).toBe(0);
try {
expect(await client.execute("health", {})).toMatchObject({
ok: true,
value: { provider: declaration.identity },
});
expect(loads).toBe(1);
expect(await client.execute("health", {})).toMatchObject({ ok: true });
expect(loads).toBe(1);
} finally {
await client.close();
}
}
});