Files
homebrewery/tests/routes/static-content.test.js
T
Trevor Buckner 4825df37a8 Remove comments; brotli tests not needed
Vite currently generates no .br files during build. There are not brotli files to test against.

Best to add those tests when they become relevant, at which point they will need to be rebuilt anyway.
2026-10-19 13:43:37 -04:00

25 lines
874 B
JavaScript

import supertest from 'supertest';
import createApp from '../../server/app.js';
let app;
let request;
beforeAll(async ()=>{
app = await createApp();
request = supertest.agent(app).set('X-Forwarded-Proto', 'https');
});
describe('Tests for static assets and cache settings', ()=>{
it('Test regular CSS file', async ()=>{
const results = await request.get('/fonts/fonts/fonts.css');
expect(results.header['content-type']).toBe('text/css; charset=utf-8');
expect(results.header['cache-control']).toBe('public, max-age: 43200, must-revalidate');
});
it('Test regular font file', async ()=>{
const results = await request.get('/fonts/fonts/open-sans-latin-400-normal.woff2');
expect(results.header['content-type']).toBe('font/woff2');
expect(results.header['cache-control']).toBe('public, max-age=2592000, must-revalidate');
});
});