import test from "node:test"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; const read = path => readFileSync(new URL(path, import.meta.url), "utf8"); test("retired listing and candidate routes point to the volunteer roster", () => { const redirects = read("../_redirects"); for (const path of ["/jobs", "/jobs/", "/jobs/*", "/candidates", "/candidates/", "/candidates/*"]) { assert.ok(redirects.includes(path + " /volunteer/ 301"), path); } for (const page of ["index.html", "help/index.html", "compare/index.html", "licenses/index.html", "privacy/index.html", "volunteer/index.html"]) { const pageSource = read("../" + page); assert.doesNotMatch(pageSource, /\bpaid\b|salaried|salary|pay range|put yourself forward|\/api\/candidates|\/jobs\//i, page); } }); test("every volunteer listing is labeled, shareable, and routes to an open trade rather than an application", () => { const page = read("../volunteer/index.html"); const roles = [...page.matchAll(/