Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
69 views

I am building a Svelte component library for my project and have run into several issues, particularly when trying to test components with slots. Here's the error I'm facing: Object literal may only ...
Józef Podlecki's user avatar
1 vote
0 answers
343 views

I am trying to test a simple Svelte component using Jest and @testing-library/svelte, but I am encountering the following error: Error ReferenceError: $state is not defined 3 | 4 | it('...
Józef Podlecki's user avatar
3 votes
1 answer
321 views

I created a Svelte component that is meant to show quickly and then disappear, merely to communicate that the action took place and how many records were touched by the action. The component is very ...
José Ramírez's user avatar
0 votes
1 answer
202 views

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 ...
fxm90's user avatar
  • 1
3 votes
1 answer
499 views

I'm struggling to understand how to effectively test SvelteKit components like this one. I want to test the selectedTaxon property, and one approach is to mock the TaxonLinkButton component. However, ...
Andrea Vassallo's user avatar
2 votes
2 answers
2k views

I want to test the props of a Svelte component with Vitest. Component: <script> export let foo </script> <div>{foo}</div> Test: const { component } = render(MyComponent, { ...
Yulian's user avatar
  • 6,849
4 votes
1 answer
2k views

In Svelte, I have a parent component which listens to a component event dispatched by a child component. I know how to use component.$on to check that the dispatched event does the right thing within ...
jrh's user avatar
  • 4,193
0 votes
1 answer
924 views

Question about 2 different methods exposed via fireEvent API in the react-testing-library. fireEvent.dblClick fireEvent.doubleClick What's the difference? And is there a recommendation to use one ...
Daniel Caldas's user avatar
1 vote
1 answer
450 views

During unit testing, I am getting undefined error, while executing svelte component with json file. Restaurant.svelte : import data from '../Data/restaurants.json'; console.log(data); let finalData = ...
muthu kumar's user avatar
4 votes
1 answer
1k views

My component: <script lang="ts"> import { Button } from 'carbon-components-svelte'; import firebase from 'firebase/app'; import { auth } from '../../firebase-shortcut'; import ...
wooseop's user avatar
  • 337
3 votes
2 answers
2k views

I wrote a svelte component App in which you can write a sentence in an input and the sentence will be render in a h1. App.svelte <script> let sentence = "Hello world"; </script>...
johannchopin's user avatar