mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
803dd8061d
* feat(container): provide a virtual module to load renderers * address feedback * chore: restore some default to allow to have PHP prototype working * Thread through renderers and manifest * Pass manifest too * update changeset * add diff * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * fix diff * rebase and update lock --------- Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
17 lines
627 B
TypeScript
17 lines
627 B
TypeScript
import { experimental_AstroContainer as AstroContainer } from 'astro/container';
|
|
import { expect, test } from 'vitest';
|
|
import ReactWrapper from '../src/components/ReactWrapper.astro';
|
|
import { loadRenderers } from 'astro:container';
|
|
import { getContainerRenderer } from '@astrojs/react';
|
|
|
|
const renderers = await loadRenderers([getContainerRenderer()]);
|
|
const container = await AstroContainer.create({
|
|
renderers,
|
|
});
|
|
|
|
test('ReactWrapper with react renderer', async () => {
|
|
const result = await container.renderToString(ReactWrapper);
|
|
|
|
expect(result).toContain('Counter');
|
|
expect(result).toContain('Count: <!-- -->5');
|
|
});
|