mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 10:25:42 +00:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import type {
|
|
AnalysisClient,
|
|
AnalysisProvider,
|
|
ProviderIdentity,
|
|
} from "./AnalysisProvider.js";
|
|
import { AnalysisProviderRegistry } from "./AnalysisProviderRegistry.js";
|
|
import { composeBinarySession } from "./BinarySessionComposition.js";
|
|
|
|
const auxiliaryProvider = (identity: ProviderIdentity): AnalysisProvider => ({
|
|
identity: () => identity,
|
|
capabilities: () => [],
|
|
createClient: (): AnalysisClient => {
|
|
throw new Error("The composition check must not create provider clients");
|
|
},
|
|
});
|
|
|
|
describe("composeBinarySession", () => {
|
|
it("exposes the complete configured provider set without starting clients", () => {
|
|
const session = composeBinarySession(new AnalysisProviderRegistry([]), [
|
|
auxiliaryProvider({
|
|
id: "test-auxiliary",
|
|
name: "Test auxiliary provider",
|
|
version: "1.0.0",
|
|
}),
|
|
]);
|
|
|
|
expect(session.providerIdentity()).toEqual({
|
|
id: "composite:test-auxiliary",
|
|
name: "REA composite analysis provider",
|
|
version: null,
|
|
});
|
|
});
|
|
});
|