Skip to content

Commit 9439eca

Browse files
committed
test(tmlpd-pi): add real smoke test — package.json referenced nonexistent test/verify.js
- Verifies dist loads + core exports (createTMLPD, ResponseCache, CostTracker) - Verifies v1.3.2 tokenOptimization module exports + SemanticCache API - Fixes broken npm test script for future contributors
1 parent e5b6c00 commit 9439eca

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎tmlpd-pi-extension/test/verify.js‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Smoke test: package compiles, core exports + tokenOptimization module load
2+
const assert = require("assert");
3+
4+
const mod = require("../dist/index.js");
5+
6+
// Core exports exist
7+
for (const name of ["createTMLPD", "TMLPDTools", "ResponseCache", "CostTracker", "ProviderRegistry"]) {
8+
assert(name in mod, `missing core export: ${name}`);
9+
}
10+
11+
// tokenOptimization sub-module loads (added v1.3.2)
12+
const to = require("../dist/tokenOptimization/index.js");
13+
for (const name of ["SemanticCache", "ContextStratifier", "TokenAwareFallback", "SchemaContractor", "FetchOnceProcessor"]) {
14+
assert(name in to, `missing tokenOptimization export: ${name}`);
15+
}
16+
17+
// SemanticCache basic behavior
18+
const cache = new to.SemanticCache({ maxEntries: 10 });
19+
assert(typeof cache.get === "function" && typeof cache.set === "function", "SemanticCache API broken");
20+
21+
console.log("✓ smoke test passed — dist loads, tokenOptimization exports verified");

0 commit comments

Comments
 (0)