Home / File/ route-manifest.test.js — astro Source File

route-manifest.test.js — astro Source File

Architecture documentation for route-manifest.test.js, a javascript file in the astro codebase.

Entity Profile

Source Code

// TODO: unskip this test
// import { expect } from 'chai';
// import { fileURLToPath } from 'node:url';
// import { createRouteManifest } from '../dist/core/routing/index.js';
// import { validateConfig } from '../dist/core/config.js';

// const cwd = new URL('./fixtures/route-manifest/', import.meta.url);

// const create = async (dir, trailingSlash) => {
// 	return createRouteManifest({
// 		config: await validateConfig({
// 			root: cwd.pathname,
// 			trailingSlash,
// 		}),
// 		cwd: fileURLToPath(cwd),
// 	});
// };
// function cleanRoutes(routes) {
// 	return routes.map((r) => {
// 		delete r.generate;
// 		return r;
// 	});
// }

// describe('route manifest', () => {
// 	it('creates routes with trailingSlashes = always', async () => {
// 		const { routes } = await create('basic', 'always');
// 		expect(cleanRoutes(routes)).to.deep.equal([
// 			{
// 				type: 'page',
// 				pattern: /^\/$/,
// 				params: [],
// 				component: 'basic/index.astro',
// 				pathname: '/',
// 			},

// 			{
// 				type: 'page',
// 				pattern: /^\/about\/$/,
// 				params: [],
// 				component: 'basic/about.astro',
// 				pathname: '/about',
// 			},

// 			{
// 				type: 'page',
// 				pattern: /^\/blog\/$/,
// 				params: [],
// 				component: 'basic/blog/index.astro',
// 				pathname: '/blog',
// 			},

// 			{
// 				type: 'page',
// 				pattern: /^\/blog\/([^/]+?)\/$/,
// 				params: ['slug'],
// 				component: 'basic/blog/[slug].astro',
// 				pathname: undefined,
// 			},
// 		]);
// ... (182 more lines)

Frequently Asked Questions

What does route-manifest.test.js do?
route-manifest.test.js is a source file in the astro codebase, written in javascript.
Where is route-manifest.test.js in the architecture?
route-manifest.test.js is located at packages/astro/test/route-manifest.test.js (directory: packages/astro/test).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free