Skip to content

Commit

Permalink
chore: import component in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 7, 2024
1 parent 236f2d7 commit 9960870
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(<Component count={1} />)
const screen = render(Component, {
initialCount: 1,
})

await screen.getByRole('button', { name: 'Increment' }).click()

Expand Down Expand Up @@ -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(<Component count={1} />)
const screen = page.render(Component, {
initialCount: 1,
})

screen.cleanup()
})
Expand Down

0 comments on commit 9960870

Please sign in to comment.