Home / File/ basics.test.js — astro Source File

basics.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  f453bde8_0dbb_b928_bac1_7be58fba3dd6["basics.test.js"]
  1c3a6eaf_e190_a7a7_4e0d_f3970df5bd14["test-utils.js"]
  f453bde8_0dbb_b928_bac1_7be58fba3dd6 --> 1c3a6eaf_e190_a7a7_4e0d_f3970df5bd14
  95df8b4a_03a9_ecbd_280c_bf8530b728ba["loadFixture"]
  f453bde8_0dbb_b928_bac1_7be58fba3dd6 --> 95df8b4a_03a9_ecbd_280c_bf8530b728ba
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  f453bde8_0dbb_b928_bac1_7be58fba3dd6 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  f453bde8_0dbb_b928_bac1_7be58fba3dd6 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  cb315bcc_59d8_fa19_79aa_5da7cd3730c5["linkedom"]
  f453bde8_0dbb_b928_bac1_7be58fba3dd6 --> cb315bcc_59d8_fa19_79aa_5da7cd3730c5
  style f453bde8_0dbb_b928_bac1_7be58fba3dd6 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 { parseHTML } from 'linkedom';
import { loadFixture } from './test-utils.js';

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

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

	it('Slots are added without the slot attribute', async () => {
		const data = await fixture.readFile('/index.html');
		const { document } = parseHTML(data);
		const bar = document.querySelector('#foo');

		assert.notEqual(bar, undefined);
		assert.equal(bar.getAttribute('slot'), null);
	});

	it('Can show images from public', async () => {
		const data = await fixture.readFile('/public/index.html');
		const { document } = parseHTML(data);
		const img = document.querySelector('img');

		assert.notEqual(img, undefined);
		assert.equal(img.getAttribute('src'), '/light_walrus.avif');
	});

	it('Should generate unique ids when using useId()', async () => {
		const data = await fixture.readFile('/index.html');
		const { document } = parseHTML(data);

		const els = document.querySelectorAll('.vue-use-id');
		assert.equal(els.length, 2);
		assert.notEqual(els[0].getAttribute('id'), els[1].getAttribute('id'));
	});
});

Domain

Dependencies

Frequently Asked Questions

What does basics.test.js do?
basics.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does basics.test.js depend on?
basics.test.js imports 5 module(s): linkedom, loadFixture, node:test, strict, test-utils.js.
Where is basics.test.js in the architecture?
basics.test.js is located at packages/integrations/vue/test/basics.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