Astro fails with svelte-testing-library

31 views Asked by At

I'm building a website using Astro and a Svelte integration. For testing I added svelte-testing-library which runs fine when being executed with npm test.

Unfortunately after adding the component tests running astro check fails for all calls to render() with

No overload matches this call.
  Overload 1 of 2, '(component: Constructor<SvelteComponent<any, any, any>>, componentOptions?: any, renderOptions?: Omit<RenderOptions<typeof import("/workspaces/workspace/node_modules/@testing-library/dom/types/queries")>, "queries"> | undefined): RenderResult<...>', gave the following error.
  Overload 2 of 2, '(component: Constructor<SvelteComponent<any, any, any>>, componentOptions?: any, renderOptions?: RenderOptions<Queries> | undefined): RenderResult<...>', gave the following error.

11   render(Greeter, { name: "Luke Skywalker" });
               ~~~~~~~~~~~

I've created a Code Sandbox to repdroduce the issue here. In components/greeter.svelte you can find the Svelte component, and in components/greeter.test.ts you can find the corresponding test.

As npm test runs through fine, I'd expect astro check to also run through without any errors. Any ideas on how to fix the error?

0

There are 0 answers