Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md (setup and step-by-step recipes) and a README in each main folder, with an index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to JSDoc @file blocks, define a three-level header template in website/AGENTS.md and check the header in tests/file-headers.test.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1 KiB
JavaScript
23 lines
1 KiB
JavaScript
/**
|
|
* @file Vérifie le parsing .env, la priorité du processus et les fichiers facultatifs.
|
|
*/
|
|
|
|
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { loadProjectEnv } from "../scripts/load-project-env.mjs";
|
|
|
|
for (const existing of ["9999", ""]) {
|
|
test(`project env preserves an existing ${existing ? "nonempty" : "empty"} value`, (t) => {
|
|
const keys = ["SOKKOG_ENV_FIXTURE_PORT", "SOKKOG_ENV_FIXTURE_QUOTED", "SOKKOG_ENV_FIXTURE_COMMENT"];
|
|
const previous = keys.map((key) => process.env[key]);
|
|
t.after(() => keys.forEach((key, index) => {
|
|
if (previous[index] === undefined) delete process.env[key];
|
|
else process.env[key] = previous[index];
|
|
}));
|
|
keys.forEach((key) => { delete process.env[key]; });
|
|
process.env.SOKKOG_ENV_FIXTURE_PORT = existing;
|
|
loadProjectEnv("tests/fixtures/project-env.txt");
|
|
loadProjectEnv("tests/fixtures/missing-env-file");
|
|
assert.deepEqual(keys.map((key) => process.env[key]), [existing, "value # inside", "value"]);
|
|
});
|
|
}
|