prerender.test.js — astro Source File
Architecture documentation for prerender.test.js, a javascript file in the astro codebase. 7 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 2588fc43_b715_c7c8_8fe9_9377fc03e607["prerender.test.js"] 760b1776_8858_e3bd_06b8_5cc4c1a9cbdc["../dist/index.js"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> 760b1776_8858_e3bd_06b8_5cc4c1a9cbdc ff334e41_2760_839e_fc38_ab9318c18dfc["test-utils.js"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> ff334e41_2760_839e_fc38_ab9318c18dfc 0b7a6b11_e910_da4b_c617_1880167f44ef["loadFixture"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> 0b7a6b11_e910_da4b_c617_1880167f44ef 0f98dbf7_3a77_7344_74c6_cb678c4a98d0["waitServerListen"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> 0f98dbf7_3a77_7344_74c6_cb678c4a98d0 e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> 6b0635f9_51ea_77aa_767b_7857878e98a6 deb87372_5629_35f8_9a54_e755a08f776a["cheerio"] 2588fc43_b715_c7c8_8fe9_9377fc03e607 --> deb87372_5629_35f8_9a54_e755a08f776a style 2588fc43_b715_c7c8_8fe9_9377fc03e607 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 * as cheerio from 'cheerio';
import nodejs from '../dist/index.js';
import { loadFixture, waitServerListen } from './test-utils.js';
/**
* @typedef {import('../../../astro/test/test-utils').Fixture} Fixture
*/
describe('Prerendering', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
let server;
describe('With base', async () => {
before(async () => {
process.env.PRERENDER = true;
fixture = await loadFixture({
base: '/some-base',
root: './fixtures/prerender/',
output: 'server',
outDir: './dist/with-base',
adapter: nodejs({ mode: 'standalone' }),
});
await fixture.build();
const { startServer } = await fixture.loadAdapterEntryModule();
const res = startServer();
server = res.server;
await waitServerListen(server.server);
});
after(async () => {
await server.stop();
await fixture.clean();
delete process.env.PRERENDER;
});
it('Can render SSR route', async () => {
const res = await fetch(`http://${server.host}:${server.port}/some-base/one`);
const html = await res.text();
const $ = cheerio.load(html);
assert.equal(res.status, 200);
assert.equal($('h1').text(), 'One');
});
it('Can render prerendered route', async () => {
const res = await fetch(`http://${server.host}:${server.port}/some-base/two`);
const html = await res.text();
const $ = cheerio.load(html);
assert.equal(res.status, 200);
assert.equal($('h1').text(), 'Two');
assert.ok(fixture.pathExists('/client/two/index.html'));
});
it('Can render prerendered route with redirect and query params', async () => {
// ... (418 more lines)
Domain
Dependencies
- ../dist/index.js
- cheerio
- loadFixture
- node:test
- strict
- test-utils.js
- waitServerListen
Source
Frequently Asked Questions
What does prerender.test.js do?
prerender.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does prerender.test.js depend on?
prerender.test.js imports 7 module(s): ../dist/index.js, cheerio, loadFixture, node:test, strict, test-utils.js, waitServerListen.
Where is prerender.test.js in the architecture?
prerender.test.js is located at packages/integrations/node/test/prerender.test.js (domain: CoreAstro, directory: packages/integrations/node/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free