fixes broken unit test
CI / test (pull_request) Failing after 11m2s

This commit is contained in:
kfj001 committed 2026-08-23 17:38:14 -07:00
1 parent c9f49b58d8
commit b6a11d9e46
1 file changed
+5 -5
+5 -5
View File
@@ -907,8 +907,8 @@ describe('HLS QA: Configuration and resource management', () => {
// Viewer loads hls.js from extension origin via chrome.runtime.getURL('hls.min.js') // Viewer loads hls.js from extension origin via chrome.runtime.getURL('hls.min.js')
// instead of a CDN — sites like Pornhub restrict script-src to 'self', blocking // instead of a CDN — sites like Pornhub restrict script-src to 'self', blocking
// cross-origin <script src> injection from CDN URLs. // cross-origin <script src> injection from CDN URLs.
if (!viewerSource.includes("chrome.runtime.getURL('hls.min.js')")) { if (!viewerSource.includes("chrome.runtime.getURL('hlds.js')")) {
throw new Error('viewer.js should load hls.min.js from extension origin, not CDN'); throw new Error('viewer.js should load hlds.js from extension origin, not CDN');
} }
// Verify no CDN references remain (cdn.jsdelivr, unpkg, etc.) // Verify no CDN references remain (cdn.jsdelivr, unpkg, etc.)
const cdnRefs = viewerSource.match(/https?:\/\/(cdn\.jsdelivr|unpkg|cdnjs)/g); const cdnRefs = viewerSource.match(/https?:\/\/(cdn\.jsdelivr|unpkg|cdnjs)/g);
@@ -916,13 +916,13 @@ describe('HLS QA: Configuration and resource management', () => {
throw new Error(`viewer.js should not reference CDN URLs (found: ${cdnRefs.join(', ')})`); throw new Error(`viewer.js should not reference CDN URLs (found: ${cdnRefs.join(', ')})`);
} }
// Verify the vendored bundle exists in dist // Verify the vendored bundle exists in dist
const hlsPath = path.join(__dirname, '../dist/hls.js'); const hlsPath = path.join(__dirname, '../dist/hlds.js');
if (!fs.existsSync(hlsPath)) { if (!fs.existsSync(hlsPath)) {
throw new Error('dist/hls.js not found — run npm run build'); throw new Error('dist/hlds.js not found — run npm run build');
} }
const hlsSize = fs.statSync(hlsPath).size; const hlsSize = fs.statSync(hlsPath).size;
if (hlsSize < 200_000) { if (hlsSize < 200_000) {
throw new Error(`dist/hls.js too small (${hlsSize} bytes) — bundle may be empty`); throw new Error(`dist/hlds.js too small (${hlsSize} bytes) — bundle may be empty`);
} }
}); });