Home / File/ custom-entryfile.test.js — astro Source File

custom-entryfile.test.js — astro Source File

Architecture documentation for custom-entryfile.test.js, a javascript file in the astro codebase. 6 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  6d393757_e876_9c3f_66cd_dc37532a32c4["custom-entryfile.test.js"]
  635e1221_67bb_e784_624a_d6d63643872b["_test-utils.js"]
  6d393757_e876_9c3f_66cd_dc37532a32c4 --> 635e1221_67bb_e784_624a_d6d63643872b
  33b9a01d_12ac_568f_9775_9e80b35139cb["loadFixture"]
  6d393757_e876_9c3f_66cd_dc37532a32c4 --> 33b9a01d_12ac_568f_9775_9e80b35139cb
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  6d393757_e876_9c3f_66cd_dc37532a32c4 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  e16a223b_37f3_6b25_1ee1_2b7bcb9d9415["node:fs"]
  6d393757_e876_9c3f_66cd_dc37532a32c4 --> e16a223b_37f3_6b25_1ee1_2b7bcb9d9415
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  6d393757_e876_9c3f_66cd_dc37532a32c4 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  6d393757_e876_9c3f_66cd_dc37532a32c4 --> d9a92db9_c95e_9165_13ac_24b3d859d946
  style 6d393757_e876_9c3f_66cd_dc37532a32c4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as assert from 'node:assert/strict';
import { existsSync } from 'node:fs';
import { after, before, describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import { loadFixture } from './_test-utils.js';

describe('Custom entry file', () => {
	let fixture;
	let previewServer;
	const root = new URL('./fixtures/custom-entryfile/', import.meta.url);

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/custom-entryfile/',
		});
		await fixture.build();
		previewServer = await fixture.preview();
	});

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

	it('filters out duplicate "default" export and builds', async () => {
		const filePath = fileURLToPath(new URL('dist/_worker.js', root));
		const hasBuilt = existsSync(filePath);
		assert.equal(hasBuilt, true, `Expected ${filePath} to exist after build`);
	});

	it('uses custom entrypoint', async () => {
		const response = await fixture.fetch('/');
		assert.equal(
			response.headers.get('X-Custom-Entrypoint'),
			'true',
			'Expected custom entrypoint to add X-Custom-Entrypoint header',
		);
	});
});

Domain

Dependencies

Frequently Asked Questions

What does custom-entryfile.test.js do?
custom-entryfile.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does custom-entryfile.test.js depend on?
custom-entryfile.test.js imports 6 module(s): _test-utils.js, loadFixture, node:fs, node:test, node:url, strict.
Where is custom-entryfile.test.js in the architecture?
custom-entryfile.test.js is located at packages/integrations/cloudflare/test/custom-entryfile.test.js (domain: CoreAstro, directory: packages/integrations/cloudflare/test).

Analyze Your Own Codebase

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

Try Supermodel Free