Merge branch 'master' into dependabot/npm_and_yarn/dev-dependencies-d73cf87b7f

This commit is contained in:
Trevor Buckner
2026-10-19 13:55:14 -04:00
committed by GitHub
2 changed files with 25 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@
"test:api-unit:css": "jest \"server/.*.spec.js\" -t \"Get CSS\" --verbose",
"test:api-unit:notifications": "jest \"server/.*.spec.js\" -t \"Notifications\" --verbose",
"test:content-negotiation": "jest \"server/middleware/.*.spec.js\" --verbose",
"test:static-content": "jest \"tests/routes/static-content.test.js\" --verbose",
"test:coverage": "jest --coverage --silent --runInBand",
"test:dev": "jest --verbose --watch",
"test:basic": "jest tests/markdown/basic.test.js --verbose",
+24
View File
@@ -0,0 +1,24 @@
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');
});
});