forked from Lilly-Protocol/agentlily-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublic-export-surface.test.ts
More file actions
42 lines (37 loc) · 1.16 KB
/
Copy pathpublic-export-surface.test.ts
File metadata and controls
42 lines (37 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { describe, it, expect } from "vitest";
import * as pkg from "../src/index.js";
describe("Public export surface of src/index.ts", () => {
const expectedClasses = [
"AgentRuntime",
"AgentInstanceManager",
"ActionExecutor",
"RuntimeError",
"RuntimeEventBus",
"InMemoryRuntimeLogger",
"InMemoryMemoryStore",
"UnconfiguredModelProvider",
"InMemoryRuntimeStateStore",
"TaskRunner",
"ToolRegistry"
];
const expectedFunctions = ["createRuntimeDependencies"];
it("exports all expected classes", () => {
for (const name of expectedClasses) {
expect(pkg).toHaveProperty(name);
expect(typeof (pkg as any)[name]).toBe("function");
}
});
it("exports all expected functions", () => {
for (const name of expectedFunctions) {
expect(pkg).toHaveProperty(name);
expect(typeof (pkg as any)[name]).toBe("function");
}
});
it("does not accidentally remove or rename public exports", () => {
const allExpected = [...expectedClasses, ...expectedFunctions];
const exportedKeys = Object.keys(pkg);
for (const name of allExpected) {
expect(exportedKeys).toContain(name);
}
});
});