سامانه صدور فاکتور و حسابداری
test: syntax-check static and runtime CSP handler bundles
davoodmehraban89 committed
Oct 2, 2026 at 01:19 UTC
055b6f1bd2240982c07f30f572040b43fc7da3c7
1 file changed
+4
-2
scripts/public-qa-regression-check.mjs
+4
-2
@@ -19,8 +19,10 @@ must(!/script-src[^;]*'unsafe-inline'/i.test(built),'deployable CSP must not all
19
must(!/\son[a-z]+=/i.test(built),'deployable HTML must not contain inline event handlers');
20
must(!/<script(?![^>]*\ssrc=)[^>]*>/i.test(built),'deployable HTML must not contain inline script blocks');
21
for(const tag of [...built.matchAll(/<script[^>]+src="https:\/\/[^\"]+"[^>]*>/gi)].map(m=>m[0]))must(/integrity=/i.test(tag),'external scripts must carry SRI');
22
-const generatedCheck=spawnSync(process.execPath,['--check','_site/js/generated-event-handlers.js'],{encoding:'utf8'});
23
-must(generatedCheck.status===0,'generated event-handler bundle must parse: '+(generatedCheck.stderr||generatedCheck.stdout));
22
+for(const file of ['_site/js/generated-event-handlers.js','_site/js/generated-dynamic-handlers.js']){
23
+ const check=spawnSync(process.execPath,['--check',file],{encoding:'utf8'});
24
+ must(check.status===0,`${file} must parse: `+(check.stderr||check.stdout));
25
+}
26
const selfcheck=fs.readFileSync('js/selfcheck.js','utf8');
27
must(/version:'1\.0'/.test(selfcheck)&&/\{version:'1\.0',run\}/.test(selfcheck),'FinoraHealth version must remain 1.0');
28
console.log('Public QA regression invariants: PASS');