mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 20:29:01 +00:00
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.
25 lines
874 B
JavaScript
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');
|
|
});
|
|
});
|