A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/questions/78236811/astro-fails-with-svelte-testing-library below:

typescript - Astro fails with svelte-testing-library

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?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4