Files
formation-manager-itinova/test/traefik-redirect-contract.test.mjs
Santinova Deployment 32b0d5edc4
Some checks failed
Validation applicative / TypeScript, tests et build (push) Failing after 1m52s
fix(formation): redirige le domaine historique vers Itinova
Co-authored-by: Manus <dev-agent@manus.ai>
2026-10-28 18:33:09 +00:00

31 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const compose = readFileSync(new URL("../docker-compose.yml", import.meta.url), "utf8");
assert.match(
compose,
/traefik\.http\.routers\.formations-legacy-redirect\.rule=Host\(`formations\.santinova-soft\.org`\)/,
"Le domaine historique doit avoir son routeur Traefik dédié.",
);
assert.match(
compose,
/traefik\.http\.routers\.formations-legacy-redirect\.middlewares=formations-legacy-redirect/,
"Le routeur historique doit appliquer le middleware de redirection.",
);
assert.match(
compose,
/traefik\.http\.middlewares\.formations-legacy-redirect\.redirectregex\.regex=\^https:\/\/formations\\\\\.santinova-soft\\\\\.org\/\(\.\*\)/,
"La redirection doit cibler uniquement le domaine historique en HTTPS.",
);
assert.match(
compose,
/traefik\.http\.middlewares\.formations-legacy-redirect\.redirectregex\.replacement=https:\/\/formations-itinova\.santinova-soft\.org\/\$\$\{1\}/,
"La redirection doit conserver le chemin vers l’URL canonique Itinova.",
);
assert.match(
compose,
/traefik\.http\.middlewares\.formations-legacy-redirect\.redirectregex\.permanent=true/,
"La redirection doit être permanente.",
);