mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 20:29:01 +00:00
Merge branch 'master' into dependabot/npm_and_yarn/dev-dependencies-d73cf87b7f
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user