mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
16 lines
463 B
TypeScript
16 lines
463 B
TypeScript
import { experimental_AstroContainer as AstroContainer } from 'astro/container';
|
|
import { expect, test } from 'vitest';
|
|
import Locale from '../src/pages/[locale].astro';
|
|
|
|
test('Dynamic route', async () => {
|
|
const container = await AstroContainer.create();
|
|
// @ts-ignore
|
|
const result = await container.renderToString(Locale, {
|
|
params: {
|
|
locale: 'en',
|
|
},
|
|
request: new Request('http://example.com/en'),
|
|
});
|
|
|
|
expect(result).toContain('Locale: en');
|
|
});
|