render-indented-components.test.js — astro Source File
Architecture documentation for render-indented-components.test.js, a javascript file in the astro codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a["render-indented-components.test.js"] 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a --> 6b0635f9_51ea_77aa_767b_7857878e98a6 cb315bcc_59d8_fa19_79aa_5da7cd3730c5["linkedom"] 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a --> cb315bcc_59d8_fa19_79aa_5da7cd3730c5 style 11dfcbc6_789d_89fa_5c3b_9ea2a1b4848a 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 { parseHTML } from 'linkedom';
import { loadFixture } from '../../../astro/test/test-utils.js';
const root = new URL('./fixtures/render-with-indented-components/', import.meta.url);
describe('Markdoc - render indented components', () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root,
});
});
describe('dev', () => {
let devServer;
before(async () => {
devServer = await fixture.startDevServer();
});
after(async () => {
await devServer.stop();
});
it('renders content - with indented components', async () => {
const res = await fixture.fetch('/');
const html = await res.text();
renderIndentedComponentsChecks(html);
});
});
describe('build', () => {
before(async () => {
await fixture.build();
});
it('renders content - with indented components', async () => {
const html = await fixture.readFile('/index.html');
renderIndentedComponentsChecks(html);
});
});
});
/** @param {string} html */
function renderIndentedComponentsChecks(html) {
const { document } = parseHTML(html);
const h2 = document.querySelector('h2');
assert.equal(h2.textContent, 'Post with indented components');
// Renders custom shortcode components
const marquees = document.querySelectorAll('marquee');
assert.equal(marquees.length, 2);
// Renders h3
const h3 = document.querySelector('h3');
assert.equal(h3.textContent, 'I am an h3!');
// Renders Astro Code component
const pre = document.querySelector('pre');
assert.notEqual(pre, null);
assert.equal(pre.className, 'astro-code github-dark');
}
Domain
Subdomains
Functions
Dependencies
- linkedom
- loadFixture
- node:test
- strict
- test-utils.js
Source
Frequently Asked Questions
What does render-indented-components.test.js do?
render-indented-components.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in render-indented-components.test.js?
render-indented-components.test.js defines 1 function(s): renderIndentedComponentsChecks.
What does render-indented-components.test.js depend on?
render-indented-components.test.js imports 5 module(s): linkedom, loadFixture, node:test, strict, test-utils.js.
Where is render-indented-components.test.js in the architecture?
render-indented-components.test.js is located at packages/integrations/markdoc/test/render-indented-components.test.js (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/integrations/markdoc/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free