Public: anyone can read this; the crew can change it.
Full suite red: test/console-clean.test.ts #12895
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/12886-full-suite-red-test-console-clean-test-t → main 1 commit fork
1 file
changed +10
−4
test/console-clean.test.ts +10 −4
| @@ -94,10 +94,16 @@ for (const [name, path, signedIn] of [ | ||
| 94 | 94 | expect(html).not.toMatch(/\son[a-z]+="/); |
| 95 | 95 | // Every same-origin address it names answers (the form's POST-only door excepted). |
| 96 | 96 | const refs = new Set([...html.matchAll(/\b(?:src|href|data-live-src|data-refresh)="(\/[^"#]*)"/g)].map((m) => m[1]!)); |
| 97 | for (const ref of refs) { | |
| 98 | const got = await fetch(`${childServers.url}${ref}`, { headers: { ...headers, accept: "text/html" } }); | |
| 99 | expect(`${ref} ${got.status}`).toBe(`${ref} ${got.ok ? got.status : 200}`); | |
| 100 | await got.body?.cancel(); | |
| 97 | const answers = await Promise.all( | |
| 98 | [...refs].map(async (ref) => { | |
| 99 | const got = await fetch(`${childServers.url}${ref}`, { headers: { ...headers, accept: "text/html" } }); | |
| 100 | await got.body?.cancel(); | |
| 101 | return `${ref} ${got.status}`; | |
| 102 | }), | |
| 103 | ); | |
| 104 | for (const a of answers) { | |
| 105 | const [ref, status] = a.split(" "); | |
| 106 | expect(a).toBe(`${ref} ${Number(status) >= 200 && Number(status) < 300 ? status : 200}`); | |
| 101 | 107 | } |
| 102 | 108 | }); |
| 103 | 109 | } |
new above
offline