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

encoded.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  8ae931f1_3254_60f3_4bee_e625daa5a1fe["encoded.test.js"]
  760b1776_8858_e3bd_06b8_5cc4c1a9cbdc["../dist/index.js"]
  8ae931f1_3254_60f3_4bee_e625daa5a1fe --> 760b1776_8858_e3bd_06b8_5cc4c1a9cbdc
  ff334e41_2760_839e_fc38_ab9318c18dfc["test-utils.js"]
  8ae931f1_3254_60f3_4bee_e625daa5a1fe --> ff334e41_2760_839e_fc38_ab9318c18dfc
  8aa05169_90cd_eb5f_1d5a_e36a77000a53["createRequestAndResponse"]
  8ae931f1_3254_60f3_4bee_e625daa5a1fe --> 8aa05169_90cd_eb5f_1d5a_e36a77000a53
  0b7a6b11_e910_da4b_c617_1880167f44ef["loadFixture"]
  8ae931f1_3254_60f3_4bee_e625daa5a1fe --> 0b7a6b11_e910_da4b_c617_1880167f44ef
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  8ae931f1_3254_60f3_4bee_e625daa5a1fe --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  8ae931f1_3254_60f3_4bee_e625daa5a1fe --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 8ae931f1_3254_60f3_4bee_e625daa5a1fe 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 nodejs from '../dist/index.js';
import { createRequestAndResponse, loadFixture } from './test-utils.js';

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

	before(async () => {
		fixture = await loadFixture({
			root: './fixtures/encoded/',
			output: 'server',
			adapter: nodejs({ mode: 'middleware' }),
		});
		await fixture.build();
	});

	it('Can get an Astro file', async () => {
		const { handler } = await import('./fixtures/encoded/dist/server/entry.mjs');
		const { req, res, text } = createRequestAndResponse({
			url: '/什么',
		});

		handler(req, res);
		req.send();

		const html = await text();
		assert.equal(html.includes('什么</h1>'), true);
	});

	it('Can get a Markdown file', async () => {
		const { handler } = await import('./fixtures/encoded/dist/server/entry.mjs');

		const { req, res, text } = createRequestAndResponse({
			url: '/blog/什么',
		});

		handler(req, res);
		req.send();

		const html = await text();
		assert.equal(html.includes('什么</h1>'), true);
	});
});

Domain

Dependencies

Frequently Asked Questions

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