Svelte
You should create a main Svelte component named App.svelte
as the entry point of your Svelte application. Your Svelte code should be linted using ESLint with the recommended configuration for Svelte.
Version
Running on Node.js v20.0.0
Supported languages
Typescript or Javascript
Testing framework
Special reminders and implementation details
js
import { render, fireEvent } from '@testing-library/svelte';
import Button from './Button.svelte';
test('button click updates count', async () => {
const { getByText } = render(Button);
const button = getByText('Click me');
await fireEvent.click(button);
expect(getByText('Clicked 1 times')).toBeInTheDocument();
});
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Remember to always keep your components modular and make use of Svelte's reactivity, stores, and lifecycle functions for efficient data handling and DOM manipulations. Utilize Svelte's concise syntax to create interactive user interfaces with minimal boilerplate.