add offline support
Sonarqube Scanner / Prepare environment (push) Successful in 14s
Sonarqube Scanner / Build and test (push) Successful in 22s
Sonarqube Scanner / SonarQube analysis (push) Failing after 1m14s
Sonarqube Scanner / Deploy to Server (push) Successful in 11s

This commit is contained in:
Florian Zumpe
2026-09-30 23:27:42 +02:00
parent 6913024af1
commit 8f4664282b
16 changed files with 1134 additions and 4 deletions
+4 -1
View File
@@ -16,13 +16,16 @@ async function clientSources() {
return Promise.all(names.filter(name => name.endsWith('.js')).map(name => read(`public/js/${name}`)));
}
test('every static HTML id is referenced by authored client JavaScript', async () => {
test('every static HTML id is referenced by client JavaScript or accessible HTML relationships', async () => {
const html = await read('public/index.html');
const scripts = (await clientSources()).join('\n');
const ids = [...html.matchAll(/\bid="([^"]+)"/g)].map(match => match[1]);
const htmlReferences = new Set([...html.matchAll(/\b(?:aria-labelledby|aria-describedby|aria-controls|for)="([^"]+)"/g)]
.flatMap(match => match[1].split(/\s+/)));
assert.ok(ids.length > 0);
for (const id of ids) {
if (htmlReferences.has(id)) continue;
assert.match(scripts, new RegExp(id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')), `unused id: ${id}`);
}
});