WebsiteBench / tasks /linkedin /solution /site /implementation /clone /tests /public-deployment.test.mjs
Download tasks/linkedin/solution/site/implementation/clone/tests/public-deployment.test.mjs from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/linkedin/solution/site/implementation/clone/tests/public-deployment.test.mjs
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/linkedin/solution/site/implementation/clone/tests/public-deployment.test.mjs
-
curl -L -o public-deployment.test.mjs https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/linkedin/solution/site/implementation/clone/tests/public-deployment.test.mjs
1.52 kB
| import assert from "node:assert/strict"; | |
| import { readFile } from "node:fs/promises"; | |
| import { join } from "node:path"; | |
| import test from "node:test"; | |
| const root = process.cwd(); | |
| test("WebsiteBench public deployment routes are wired without QQ SMTP or Stripe coupling", async () => { | |
| const sendCode = await readFile(join(root, "app", "api", "auth", "send-code", "route.ts"), "utf8"); | |
| const verifyCode = await readFile(join(root, "app", "api", "auth", "verify-code", "route.ts"), "utf8"); | |
| const publicRegister = await readFile(join(root, "app", "public-register", "route.ts"), "utf8"); | |
| const dockerfile = await readFile(join(root, "Dockerfile.public"), "utf8"); | |
| const readme = await readFile(join(root, "deploy", "README-public-deployment.md"), "utf8"); | |
| assert.match(sendCode, /issuePublicRegistrationCode/); | |
| assert.match(verifyCode, /verifyPublicRegistrationCode/); | |
| assert.match(publicRegister, /consumePublicRegistrationTicket/); | |
| assert.match(publicRegister, /headers:\s*\{\s*Location:\s*"\/feed"\s*\}/s); | |
| assert.doesNotMatch(publicRegister, /NextResponse\.redirect\(new URL\("\/feed"/); | |
| assert.doesNotMatch(sendCode + verifyCode + publicRegister, /nodemailer|SMTP|QQ|stripe/i); | |
| assert.match(dockerfile, /PUBLIC_CLONE_AUTH_MODE=redis-resend/); | |
| assert.match(dockerfile, /PUBLIC_CLONE_AUTH_REDIS_REST_URL=http:\/\/redis\.internal/); | |
| assert.match(dockerfile, /PUBLIC_CLONE_AUTH_RESEND_API_URL=http:\/\/resend\.internal\/emails/); | |
| assert.match(readme, /Stripe remains workflow-pending/); | |
| }); | |