Home / File/ app-entrypoint.test.js — astro Source File

app-entrypoint.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  496510a8_f0a8_0267_0c58_6273c6a97bdc["app-entrypoint.test.js"]
  1c3a6eaf_e190_a7a7_4e0d_f3970df5bd14["test-utils.js"]
  496510a8_f0a8_0267_0c58_6273c6a97bdc --> 1c3a6eaf_e190_a7a7_4e0d_f3970df5bd14
  95df8b4a_03a9_ecbd_280c_bf8530b728ba["loadFixture"]
  496510a8_f0a8_0267_0c58_6273c6a97bdc --> 95df8b4a_03a9_ecbd_280c_bf8530b728ba
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  496510a8_f0a8_0267_0c58_6273c6a97bdc --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  496510a8_f0a8_0267_0c58_6273c6a97bdc --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  deb87372_5629_35f8_9a54_e755a08f776a["cheerio"]
  496510a8_f0a8_0267_0c58_6273c6a97bdc --> deb87372_5629_35f8_9a54_e755a08f776a
  cb315bcc_59d8_fa19_79aa_5da7cd3730c5["linkedom"]
  496510a8_f0a8_0267_0c58_6273c6a97bdc --> cb315bcc_59d8_fa19_79aa_5da7cd3730c5
  style 496510a8_f0a8_0267_0c58_6273c6a97bdc 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 { load as cheerioLoad } from 'cheerio';
import { parseHTML } from 'linkedom';
import { loadFixture } from './test-utils.js';

describe('App Entrypoint', () => {
	/** @type {import('./test-utils').Fixture} */
	let fixture;

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/app-entrypoint/',
		});
		await fixture.build();
	});

	it('loads during SSR', async () => {
		const html = await fixture.readFile('/index.html');
		const $ = cheerioLoad(html);

		// test 1: basic component renders
		assert.equal($('#foo > #bar').text(), 'works');

		// test 2: component with multiple script blocks renders and exports
		// values from non setup block correctly
		assert.equal($('#multiple-script-blocks').text(), '2 4');

		// test 3: component using generics renders
		assert.equal($('#generics').text(), 'generic');

		// test 4: component using generics and multiple script blocks renders
		assert.equal($('#generics-and-blocks').text(), '1 3!!!');
	});

	it('loads svg components without transforming them to assets', async () => {
		const data = await fixture.readFile('/index.html');
		const { document } = parseHTML(data);
		const client = document.querySelector('astro-island svg');

		assert.notEqual(client, undefined);
	});
});

describe('App Entrypoint no export default (dev)', () => {
	/** @type {import('./test-utils').Fixture} */
	let fixture;
	let devServer;

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/app-entrypoint-no-export-default/',
		});
		devServer = await fixture.startDevServer();
	});

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

// ... (140 more lines)

Domain

Dependencies

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free