Home / File/ preview-headers.test.js — astro Source File

preview-headers.test.js — astro Source File

Architecture documentation for preview-headers.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  9356f924_0915_7926_8718_f36e264a623d["preview-headers.test.js"]
  760b1776_8858_e3bd_06b8_5cc4c1a9cbdc["../dist/index.js"]
  9356f924_0915_7926_8718_f36e264a623d --> 760b1776_8858_e3bd_06b8_5cc4c1a9cbdc
  ff334e41_2760_839e_fc38_ab9318c18dfc["test-utils.js"]
  9356f924_0915_7926_8718_f36e264a623d --> ff334e41_2760_839e_fc38_ab9318c18dfc
  0b7a6b11_e910_da4b_c617_1880167f44ef["loadFixture"]
  9356f924_0915_7926_8718_f36e264a623d --> 0b7a6b11_e910_da4b_c617_1880167f44ef
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  9356f924_0915_7926_8718_f36e264a623d --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  9356f924_0915_7926_8718_f36e264a623d --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 9356f924_0915_7926_8718_f36e264a623d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import nodejs from '../dist/index.js';
import { loadFixture } from './test-utils.js';

describe('Astro preview headers', () => {
	/** @type {import('./test-utils').Fixture} */
	let fixture;
	let devPreview;
	const headers = {
		astro: 'test',
	};

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/preview-headers/',
			output: 'server',
			adapter: nodejs({ mode: 'standalone' }),
			server: {
				headers,
			},
		});
		await fixture.build();
		devPreview = await fixture.preview();
	});

	after(async () => {
		await devPreview.stop();
	});

	describe('Preview Headers', () => {
		it('returns custom headers for valid URLs', async () => {
			const result = await fixture.fetch('/');
			assert.equal(result.status, 200);
			assert.equal(Object.fromEntries(result.headers).astro, headers.astro);
		});
	});
});

Domain

Dependencies

Frequently Asked Questions

What does preview-headers.test.js do?
preview-headers.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does preview-headers.test.js depend on?
preview-headers.test.js imports 5 module(s): ../dist/index.js, loadFixture, node:test, strict, test-utils.js.
Where is preview-headers.test.js in the architecture?
preview-headers.test.js is located at packages/integrations/node/test/preview-headers.test.js (domain: CoreAstro, directory: packages/integrations/node/test).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free