mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 01:12:16 +00:00
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:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user