mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -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');
|
|
});
|