0 votes
0 answers
59 views
Issue: slots Field in Typings for Svelte Component TestingI 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 ...
asked Dec 7, 2024 at 14:490 votes
0 answers
16 views
Unit tests for async url parameters in Svelte and JestIn Svelte onMount I'm doing following logic. onMount(async () => { projectId = await new URLSearchParams(window.location.search).get('p'); jobId = await new URLSearchParams(window.location....
asked Nov 25, 2024 at 17:251 vote
0 answers
319 views
$state is not defined when testing Svelte componentI 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('...
asked Nov 18, 2024 at 11:373 votes
1 answer
298 views
Unit testing code that fires at the end of the intro animation in SvelteI 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 ...
asked May 3, 2024 at 22:400 votes
1 answer
187 views
Astro fails with svelte-testing-libraryI'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 ...
asked Mar 28, 2024 at 8:343 votes
1 answer
481 views
How can I effectively test SvelteKit components, including monitoring reactive properties and props passed to child components?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, ...
asked Nov 7, 2023 at 7:302 votes
2 answers
2k views
How to test Svelte component props with Vitest?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, { ...
asked Feb 13, 2023 at 11:254 votes
1 answer
2k views
How to test the reaction to a component event in Svelte?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 ...
asked Nov 6, 2022 at 13:220 votes
1 answer
898 views
Difference between fireEvent.dblClick & fireEvent.doubleClick in testing library?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 ...
asked Aug 30, 2022 at 19:591 vote
1 answer
443 views
Svelte - Not able to fetch data from JSON file during jest unit testingDuring 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 = ...
asked May 3, 2022 at 10:084 votes
1 answer
1k views
Svelte testing library won't detect component updatesMy component: <script lang="ts"> import { Button } from 'carbon-components-svelte'; import firebase from 'firebase/app'; import { auth } from '../../firebase-shortcut'; import ...
asked Dec 22, 2020 at 18:333 votes
2 answers
2k views
How to test svelte input reactivity?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>...
asked Aug 10, 2020 at 16:13RetroSearch 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