diff --git a/test/CodeQuality.spec.ts b/test/CodeQuality.spec.ts index 719b9cca6..c3f6a8dfd 100644 --- a/test/CodeQuality.spec.ts +++ b/test/CodeQuality.spec.ts @@ -76,13 +76,14 @@ function _arrayBufferToBase64(buffer) { return btoa(binary) } +const cachedHashes: Record = {} + async function validateScriptIntegrityOf(path: string): Promise { const htmlContents = readFileSync(path, "utf8") const doc = parse_html(htmlContents) // @ts-ignore const scripts = Array.from(doc.getElementsByTagName("script")) // Maps source URL onto hash - const cachedHashes: Record = {} const failed = new Set() for (const script of scripts) { let src = script.getAttribute("src")