08919752e3
Checkpoint multi-chantiers (arbre vert : tsc 0 erreur, 70 tests, build OK). - tâche 1.9 Phase 1 : schéma socle (machine_state/events/reports/raw_artifacts/ hardware/metrics + colonnes étendues) + wiring refresh/execute. Migration 0002. - tâche 1.9 Phase 2 : machine_credentials + machine_host_keys (non destructif, dual-read + backfill). Migration 0003. Fix séquence journal de migration. - tâche 2 : SJ-0 (types étendus rétro-compatibles, réducteur Docker, resolveTemplate), SJ-1 (update-analyze enrichi), SJ-2 (apply + diff dpkg + timeout inactivité SSH), SJ-3 (reboot vérifié boot_id). - WIP parallèle inclus : /api/capabilities, auth/apiTokens/apiClients, system metrics, scaffold app_rust, ajustements frontend. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
900 B
TypeScript
24 lines
900 B
TypeScript
// server/templates/render.test.ts
|
|
import { describe, it, expect } from "vitest";
|
|
import { renderTemplate } from "./render.js";
|
|
|
|
describe("renderTemplate", () => {
|
|
it("rend check.sh.tpl sans proxy", () => {
|
|
const out = renderTemplate("apt/check.sh.tpl", { aptProxy: null });
|
|
expect(out).toContain("apt-get update -qq");
|
|
expect(out).toContain("===SU:SIMULATE===");
|
|
expect(out).not.toContain("http_proxy");
|
|
});
|
|
|
|
it("injecte le proxy quand fourni", () => {
|
|
const out = renderTemplate("apt/check.sh.tpl", { aptProxy: "http://cache:3142" });
|
|
expect(out).toContain('http_proxy="http://cache:3142"');
|
|
});
|
|
|
|
it("rend update-analyze.sh.tpl avec les sections attendues", () => {
|
|
const out = renderTemplate("apt/update-analyze.sh.tpl", { aptProxy: null });
|
|
expect(out).toContain("===SU:APT_SIM_DISTUPGRADE===");
|
|
expect(out).toContain("apt-mark showhold");
|
|
});
|
|
});
|