README said runtime settings live in public/config.json, which the build replaces with config/runtime/<profile>.json, and named none of APP_PROFILE, RUNTIME_*, VITE_BUILD_ID, RELEASE_ID or RELEASE_TARGET. A unit test now requires README to name every variable the generator and admission read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
847 B
TypeScript
25 lines
847 B
TypeScript
import { readFileSync } from "node:fs";
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { RUNTIME_OVERRIDES } from "../../scripts/generate-runtime-config.ts";
|
|
|
|
// 13-15. README said runtime settings live in public/config.json, which the
|
|
// build replaces with config/runtime/<profile>.json, and named none of the
|
|
// variables a production build needs.
|
|
describe("runtime configuration documentation", () => {
|
|
it("names every build and deploy variable in the README", () => {
|
|
const readme = readFileSync("README.md", "utf8");
|
|
for (const variable of [
|
|
"APP_PROFILE",
|
|
"RELEASE_TARGET",
|
|
"VITE_BUILD_ID",
|
|
"RELEASE_ID",
|
|
...Object.values(RUNTIME_OVERRIDES),
|
|
]) {
|
|
expect(readme, variable).toContain(`\`${variable}\``);
|
|
}
|
|
expect(readme).toContain("config/runtime/<profile>.json");
|
|
});
|
|
});
|