~james/core

core/web/src/env.test.ts -rw-r--r-- 468 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 14 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
import { describe, expect, it } from "vitest";
import { resolveConfig } from "#lib/server/config.ts";
import { variables } from "./env.ts";

describe("env variables", () => {
	it("declare everything resolveConfig reads, the rest never reach the server", () => {
		const read = new Set<string>();
		resolveConfig(new Proxy({}, { get: (_, name) => (read.add(String(name)), undefined) }));
		expect([...read].filter((name) => !(name in variables))).toEqual([]);
	});
});