import { strict as assert } from 'node:assert'; import { describe, it } from 'node:test'; import { parseEnvFile } from '../src/env.ts'; import { Html, escapeHtml, html, join } from '../src/render/html.ts'; describe('parseEnvFile', () => { it('reads keys, skips comments and blanks, and strips quotes', () => { const values = parseEnvFile( [ '# a comment', '', 'ADMIN_PASSWORD_HASH=scrypt$1$2$3$abc$def', 'export SESSION_SECRET="quoted value"', "OTHER='single quoted'", 'not a pair', 'EMPTY=', ].join('\n'), ); assert.deepEqual(values, { ADMIN_PASSWORD_HASH: 'scrypt$1$2$3$abc$def', SESSION_SECRET: 'quoted value', OTHER: 'single quoted', EMPTY: '', }); }); }); describe('the html builder', () => { it('escapes interpolated values', () => { const rendered = html`

${'