import test from "node:test"; import assert from "node:assert/strict"; import request from "supertest"; import { createApp } from "../server/app.js"; import { root, password, setup, signup } from "./helpers.js"; test("strict CSP/static modules, no-store data, auth lifecycle, and ownership share one database", async () => { const { db, app, agent: first } = await setup(); const second = request.agent(app); const anonymous = request.agent(app); const marketing = await anonymous.get("/"); assert.equal(marketing.status, 200); assert.match( marketing.headers["content-security-policy"], /default-src 'self'/, ); assert.doesNotMatch( marketing.headers["content-security-policy"], /(?:default-src|script-src)[^;]*unsafe-inline/, ); assert.match(marketing.text, /Get started/); const login = await anonymous.get("/login"); assert.equal(login.status, 200); assert.match( login.text, /