summaryrefslogtreecommitdiff
path: root/examples/container-with-vitest/test/ReactWrapper.test.ts
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <my.burning@gmail.com> 2024-06-05 11:39:42 +0100
committerGravatar GitHub <noreply@github.com> 2024-06-05 11:39:42 +0100
commit803dd8061df02138b4928442bcb76e77dcf6f5e7 (patch)
treec3ed3580e82716ea436dc783fdb31dd8bbc9f647 /examples/container-with-vitest/test/ReactWrapper.test.ts
parent587e75f47efa346139b71e5e754e051f72bdac39 (diff)
downloadastro-803dd8061df02138b4928442bcb76e77dcf6f5e7.tar.gz
astro-803dd8061df02138b4928442bcb76e77dcf6f5e7.tar.zst
astro-803dd8061df02138b4928442bcb76e77dcf6f5e7.zip
feat(container): provide a virtual module to load renderers (#11144)
* 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>
Diffstat (limited to 'examples/container-with-vitest/test/ReactWrapper.test.ts')
-rw-r--r--examples/container-with-vitest/test/ReactWrapper.test.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/container-with-vitest/test/ReactWrapper.test.ts b/examples/container-with-vitest/test/ReactWrapper.test.ts
index 91e3dd09d..70b938708 100644
--- a/examples/container-with-vitest/test/ReactWrapper.test.ts
+++ b/examples/container-with-vitest/test/ReactWrapper.test.ts
@@ -1,17 +1,15 @@
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 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');