From 16aa76c261c1559e88cb6a39b71923d0638750c1 Mon Sep 17 00:00:00 2001 From: Andrew Aquino Date: Thu, 12 Sep 2024 10:39:46 -0700 Subject: [PATCH] fix(browser): make example test callbacks async (#6484) --- packages/vitest/src/create/browser/examples.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vitest/src/create/browser/examples.ts b/packages/vitest/src/create/browser/examples.ts index 6be47158ca88..ec23221f3478 100644 --- a/packages/vitest/src/create/browser/examples.ts +++ b/packages/vitest/src/create/browser/examples.ts @@ -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() await expect.element(getByText('Hello Vitest!')).toBeInTheDocument() }) @@ -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' }, }) @@ -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() })