import { DyNTS_resolveStaticCacheControlHeader } from './static-cache-control.util'; describe('DyNTS_resolveStaticCacheControlHeader', () => { // AAA: Arrange-Act-Assert it('a index.html-t no-cache-eli (NEM immutable), hogy a friss bundle-referenciák eljussanak', () => { // Arrange + Act const header: string = DyNTS_resolveStaticCacheControlHeader({ filePath: '/app/client-dist/index.html', assetCacheMaxAge: 31536000, assetCacheImmutable: true, }); // Assert expect(header).toBe('no-cache'); }); it('bármely .html fájlt no-cache-el (nem csak az index.html-t)', () => { const header: string = DyNTS_resolveStaticCacheControlHeader({ filePath: '/app/client-dist/some-page.html', assetCacheMaxAge: 31536000, assetCacheImmutable: true, }); expect(header).toBe('no-cache'); }); it('a hash-elt asset-eket immutable long-cache-eli, ha assetCacheImmutable=true', () => { const header: string = DyNTS_resolveStaticCacheControlHeader({ filePath: '/app/client-dist/main-A1B2C3D4.js', assetCacheMaxAge: 31536000, assetCacheImmutable: true, }); expect(header).toBe('max-age=31536000, immutable'); }); it('a hash-elt asset-eket immutable NÉLKÜL cache-eli, ha assetCacheImmutable=false', () => { const header: string = DyNTS_resolveStaticCacheControlHeader({ filePath: '/app/client-dist/styles-99ZZ.css', assetCacheMaxAge: 3600, assetCacheImmutable: false, }); expect(header).toBe('max-age=3600'); }); });