feat: harden runtime readiness and session workflow
This commit is contained in:
@@ -24,6 +24,17 @@ test("sessionNew parses id from JSON", async () => {
|
||||
expect(await r.sessionNew({ question: "q" })).toEqual({ id: "2026-06-27-100000-x" });
|
||||
});
|
||||
|
||||
test("searchPack persists retrieval context with session and workspace", async () => {
|
||||
const calls: any[] = [];
|
||||
const r = new ThtRunner({ thtBin: "tht", harnessDir: "/h", configPath: "config/tht.yaml" });
|
||||
r.run = async (args, workspace) => {
|
||||
calls.push({ args, workspace });
|
||||
return { code: 0, stdout: "", stderr: "" };
|
||||
};
|
||||
await r.searchPack("domanda", "sid", "psd");
|
||||
expect(calls).toEqual([{ args: ["search", "pack", "domanda", "--session", "sid"], workspace: "psd" }]);
|
||||
});
|
||||
|
||||
test("run passes configured THT_DATA_ROOT and preserves the remaining environment", async () => {
|
||||
const previousDataRoot = process.env.THT_DATA_ROOT;
|
||||
const previousCa = process.env.NODE_EXTRA_CA_CERTS;
|
||||
|
||||
Reference in New Issue
Block a user