static-headers.test.js — astro Source File
Architecture documentation for static-headers.test.js, a javascript file in the astro codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 3aaaf192_42d1_f219_b835_0e775567646b["static-headers.test.js"] 81c783ff_7259_703c_7bdc_c78ff183642d["test-utils.js"] 3aaaf192_42d1_f219_b835_0e775567646b --> 81c783ff_7259_703c_7bdc_c78ff183642d f0817fb3_f192_bfcf_f1b0_c1a429dad07b["loadFixture"] 3aaaf192_42d1_f219_b835_0e775567646b --> f0817fb3_f192_bfcf_f1b0_c1a429dad07b e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 3aaaf192_42d1_f219_b835_0e775567646b --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 3aaaf192_42d1_f219_b835_0e775567646b --> 6b0635f9_51ea_77aa_767b_7857878e98a6 style 3aaaf192_42d1_f219_b835_0e775567646b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import * as assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
describe('Static headers', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root: './fixtures/static-headers',
});
await fixture.build();
});
it('CSP headers are added when CSP is enabled', async () => {
const config = JSON.parse(await fixture.readFile('../.vercel/output/config.json'));
const routes = config.routes;
const headers = routes.find((x) => x.src === '/').headers;
assert.ok(headers['content-security-policy'], 'the index must have CSP headers');
assert.ok(
headers['content-security-policy'].includes('script-src'),
'must contain the script-src directive because of the server island',
);
});
});
Domain
Dependencies
- loadFixture
- node:test
- strict
- test-utils.js
Source
Frequently Asked Questions
What does static-headers.test.js do?
static-headers.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does static-headers.test.js depend on?
static-headers.test.js imports 4 module(s): loadFixture, node:test, strict, test-utils.js.
Where is static-headers.test.js in the architecture?
static-headers.test.js is located at packages/integrations/vercel/test/static-headers.test.js (domain: CoreAstro, directory: packages/integrations/vercel/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free