mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
20 lines
604 B
TypeScript
20 lines
604 B
TypeScript
|
import { experimental_AstroContainer as AstroContainer } from 'astro/container';
|
||
|
import { expect, test } from 'vitest';
|
||
|
import ReactWrapper from '../src/components/ReactWrapper.astro';
|
||
|
|
||
|
test('ReactWrapper with react renderer', async () => {
|
||
|
const container = await AstroContainer.create({
|
||
|
renderers: [
|
||
|
{
|
||
|
name: '@astrojs/react',
|
||
|
clientEntrypoint: "@astrojs/react/client.js",
|
||
|
serverEntrypoint: "@astrojs/react/server.js",
|
||
|
}
|
||
|
]
|
||
|
});
|
||
|
const result = await container.renderToString(ReactWrapper);
|
||
|
|
||
|
expect(result).toContain('Counter');
|
||
|
expect(result).toContain('Count: <!-- -->5');
|
||
|
});
|