From 99608709c9e99180aa6865354ebd2085dce06eeb Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Wed, 7 Aug 2024 15:42:40 +0200 Subject: [PATCH] chore: import component in readme --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a656131..3458b28 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,12 @@ Requires `vitest` and `@vitest/browser` 2.1.0 or higher. ```tsx import { render } from 'vitest-browser-svelte' import { expect, test } from 'vitest' +import Component from './Component.svelte' test('counter button increments the count', async () => { - const screen = render() + const screen = render(Component, { + initialCount: 1, + }) await screen.getByRole('button', { name: 'Increment' }).click() @@ -38,9 +41,12 @@ export default defineConfig({ ```tsx import { page } from '@vitest/browser/context' +import Component from './Component.svelte' test('counter button increments the count', async () => { - const screen = page.render() + const screen = page.render(Component, { + initialCount: 1, + }) screen.cleanup() })