test(platform): cover static asset cache boundaries

Exercise the filename and path boundaries used to decide which static assets can be cached permanently, including unhashed Brotli copies.
This commit is contained in:
Maurice
2026-12-01 21:22:35 +01:00
parent 756ef14b97
commit 56b4568a16
@@ -681,8 +681,14 @@ describe('applyPlatformStatic', () => {
expect(header('/app/public/sw.js')).toBeUndefined();
expect(header('/app/public/icons/icon-192.png')).toBeUndefined();
expect(header('/app/public/assets/plain.js')).toBeUndefined();
expect(header('/app/public/assets/Map-a1B2c3D.js')).toBeUndefined();
expect(header('/app/public/assets/Map-a1B2c3D4')).toBeUndefined();
expect(header('/app/public/assets/Map-a1B2c3D4.')).toBeUndefined();
expect(header('/app/public/assets/')).toBeUndefined();
expect(header('assets/Map-a1B2c3D4.css')).toBeUndefined();
// The Brotli copy of a hashed file (precompressed-static.ts) never changes either.
expect(header('/app/public/assets/index-DbM4_q2x.js.br')).toBe('public, max-age=31536000, immutable');
expect(header('/app/public/assets/plain.js.br')).toBeUndefined();
expect(header('/app/public/sw.js.br')).toBeUndefined();
});
});