From 56b4568a16c675d47a5e43d527f76e22b4a63e7f Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 1 Dec 2026 21:22:35 +0100 Subject: [PATCH] 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. --- server/tests/unit/nest/platform.controller.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/tests/unit/nest/platform.controller.test.ts b/server/tests/unit/nest/platform.controller.test.ts index ca4070514..ff0df72c5 100644 --- a/server/tests/unit/nest/platform.controller.test.ts +++ b/server/tests/unit/nest/platform.controller.test.ts @@ -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(); }); });