special-chars-in-component-imports.test.js — astro Source File
Architecture documentation for special-chars-in-component-imports.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 38f52370_4b76_333a_92f2_ec61667ecb5d["special-chars-in-component-imports.test.js"] 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] 38f52370_4b76_333a_92f2_ec61667ecb5d --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] 38f52370_4b76_333a_92f2_ec61667ecb5d --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 38f52370_4b76_333a_92f2_ec61667ecb5d --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 38f52370_4b76_333a_92f2_ec61667ecb5d --> 6b0635f9_51ea_77aa_767b_7857878e98a6 deb87372_5629_35f8_9a54_e755a08f776a["cheerio"] 38f52370_4b76_333a_92f2_ec61667ecb5d --> deb87372_5629_35f8_9a54_e755a08f776a style 38f52370_4b76_333a_92f2_ec61667ecb5d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { load as cheerioLoad } from 'cheerio';
import { isWindows, loadFixture } from './test-utils.js';
describe('Special chars in component import paths', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
const componentIds = [
'caret',
'rocket',
// Not supported as import identifier in Vite
// 'percent',
'space',
'round-bracket',
'square-bracket',
];
before(async () => {
fixture = await loadFixture({
root: './fixtures/special-chars-in-component-imports/',
});
});
describe('build', () => {
before(async () => {
await fixture.build();
});
it('Build succeeds', async () => {
const html = await fixture.readFile('/index.html');
assert.equal(html.includes('<html>'), true);
});
it('Special chars in imports work from .astro files', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerioLoad(html);
// Test 1: Correct page
assert.equal($('h1').text().includes('.astro'), true);
// Test 2: All components exist
componentIds.forEach((componentId) => {
assert.equal($(`#${componentId}`).length, 1, `Component #${componentId} does not exist`);
});
// Test 3: Component contents were rendered properly
componentIds.forEach((componentId) => {
assert.equal($(`#${componentId} > div`).text(), `${componentId}: 0`);
});
// Test 4: There is an island for each component
assert.equal($('astro-island[uid]').length, componentIds.length);
});
it('Special chars in imports work from .mdx files', async () => {
const html = await fixture.readFile('/mdx/index.html');
const $ = cheerioLoad(html);
// ... (75 more lines)
Domain
Dependencies
- cheerio
- loadFixture
- node:test
- strict
- test-utils.js
Source
Frequently Asked Questions
What does special-chars-in-component-imports.test.js do?
special-chars-in-component-imports.test.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain.
What does special-chars-in-component-imports.test.js depend on?
special-chars-in-component-imports.test.js imports 5 module(s): cheerio, loadFixture, node:test, strict, test-utils.js.
Where is special-chars-in-component-imports.test.js in the architecture?
special-chars-in-component-imports.test.js is located at packages/astro/test/special-chars-in-component-imports.test.js (domain: IntegrationAdapters, directory: packages/astro/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free