rewrite.test.js — astro Source File
Architecture documentation for rewrite.test.js, a javascript file in the astro codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 18ff9bd6_badd_15f7_3a38_205cf06d1bcf["rewrite.test.js"] be670a78_841c_46e5_0af5_c5c328869ecb["test-adapter.js"] 18ff9bd6_badd_15f7_3a38_205cf06d1bcf --> be670a78_841c_46e5_0af5_c5c328869ecb 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] 18ff9bd6_badd_15f7_3a38_205cf06d1bcf --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] 18ff9bd6_badd_15f7_3a38_205cf06d1bcf --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 18ff9bd6_badd_15f7_3a38_205cf06d1bcf --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 18ff9bd6_badd_15f7_3a38_205cf06d1bcf --> 6b0635f9_51ea_77aa_767b_7857878e98a6 deb87372_5629_35f8_9a54_e755a08f776a["cheerio"] 18ff9bd6_badd_15f7_3a38_205cf06d1bcf --> deb87372_5629_35f8_9a54_e755a08f776a style 18ff9bd6_badd_15f7_3a38_205cf06d1bcf 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 testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';
describe('Dev reroute', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
let devServer;
before(async () => {
fixture = await loadFixture({
root: './fixtures/reroute/',
});
devServer = await fixture.startDevServer();
});
after(async () => {
await devServer.stop();
});
it('should render the index page when navigating /reroute ', async () => {
const html = await fixture.fetch('/reroute').then((res) => res.text());
const $ = cheerioLoad(html);
assert.equal($('h1').text(), 'Index');
assert.equal($('h2').text(), 'Origin: /reroute/');
});
it('should render the index page when navigating /blog/hello ', async () => {
const html = await fixture.fetch('/blog/hello').then((res) => res.text());
const $ = cheerioLoad(html);
assert.equal($('h1').text(), 'Index');
});
it('should render the index page when navigating /blog/salut ', async () => {
const html = await fixture.fetch('/blog/salut').then((res) => res.text());
const $ = cheerioLoad(html);
assert.equal($('h1').text(), 'Index');
});
it('should render the index page when navigating dynamic route /dynamic/[id] ', async () => {
const html = await fixture.fetch('/dynamic/hello').then((res) => res.text());
const $ = cheerioLoad(html);
assert.equal($('h1').text(), 'Index');
});
it('should render the index page when navigating spread route /spread/[...spread] ', async () => {
const html = await fixture.fetch('/spread/hello').then((res) => res.text());
const $ = cheerioLoad(html);
assert.equal($('h1').text(), 'Index');
});
it('should render the index page when rewriting from a non-ASCII path /redirected/héllo ', async () => {
const html = await fixture.fetch('/redirected/h%C3%A9llo').then((res) => res.text());
// ... (750 more lines)
Domain
Dependencies
- cheerio
- loadFixture
- node:test
- strict
- test-adapter.js
- test-utils.js
Source
Frequently Asked Questions
What does rewrite.test.js do?
rewrite.test.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain.
What does rewrite.test.js depend on?
rewrite.test.js imports 6 module(s): cheerio, loadFixture, node:test, strict, test-adapter.js, test-utils.js.
Where is rewrite.test.js in the architecture?
rewrite.test.js is located at packages/astro/test/rewrite.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