mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-07-17 22:20:19 +00:00
19 lines
732 B
TypeScript
19 lines
732 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
getStaticCacheControl,
|
|
IMMUTABLE_ASSET_CACHE_CONTROL,
|
|
SPA_ENTRY_CACHE_CONTROL,
|
|
} from '../../packages/server/src/middleware/static-cache'
|
|
|
|
describe('static cache headers', () => {
|
|
it('caches fingerprinted build assets as immutable', () => {
|
|
expect(getStaticCacheControl('assets/js/index-abc123.js')).toBe(IMMUTABLE_ASSET_CACHE_CONTROL)
|
|
expect(getStaticCacheControl('assets\\css\\index-abc123.css')).toBe(IMMUTABLE_ASSET_CACHE_CONTROL)
|
|
})
|
|
|
|
it('revalidates the SPA entry and leaves public assets unchanged', () => {
|
|
expect(getStaticCacheControl('index.html')).toBe(SPA_ENTRY_CACHE_CONTROL)
|
|
expect(getStaticCacheControl('logo.png')).toBeNull()
|
|
})
|
|
})
|