Skip to content

Commit

Permalink
fix: make example test callbacks async
Browse files Browse the repository at this point in the history
A missing `async` threw an error in the Learn With Jason livestream on Vitest browser mode with Vladimir Sheremet.

Browser mode looks super cool!
  • Loading branch information
aqandrew committed Sep 12, 2024
1 parent 9f1fd18 commit a8c26ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vitest/src/create/browser/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { expect, test } from 'vitest'
import { render } from '@testing-library/jsx'
import HelloWorld from './HelloWorld.jsx'
test('renders name', () => {
test('renders name', async () => {
const { getByText } = render(<HelloWorld name="Vitest" />)
await expect.element(getByText('Hello Vitest!')).toBeInTheDocument()
})
Expand Down Expand Up @@ -67,7 +67,7 @@ import { expect, test } from 'vitest'
import { render } from 'vitest-browser-vue'
import HelloWorld from './HelloWorld.vue'
test('renders name', () => {
test('renders name', async () => {
const { getByText } = render(HelloWorld, {
props: { name: 'Vitest' },
})
Expand Down Expand Up @@ -97,7 +97,7 @@ import { expect, test } from 'vitest'
import { render } from 'vitest-browser-svelte'
import HelloWorld from './HelloWorld.svelte'
test('renders name', () => {
test('renders name', async () => {
const { getByText } = render(HelloWorld, { name: 'Vitest' })
await expect.element(getByText('Hello Vitest!')).toBeInTheDocument()
})
Expand Down

0 comments on commit a8c26ab

Please sign in to comment.