From f9b52c1be16329a0ca5ae5d67a4b3141b4389714 Mon Sep 17 00:00:00 2001 From: stygian-desolator <73412177+stygian-desolator@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:35:25 +0800 Subject: [PATCH] fix: remove `describe` async support (#746) --- examples/lit/test/basic.test.ts | 2 +- examples/puppeteer/test/basic.test.ts | 2 +- examples/react-testing-lib/src/components/input.test.tsx | 2 +- packages/vitest/src/types/tasks.ts | 2 +- test/fails/test/runner.test.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/lit/test/basic.test.ts b/examples/lit/test/basic.test.ts index 4199e2fba677..8d7fd1a97ac6 100644 --- a/examples/lit/test/basic.test.ts +++ b/examples/lit/test/basic.test.ts @@ -7,7 +7,7 @@ declare global { interface Window extends IWindow {} } -describe('Button with increment', async() => { +describe('Button with increment', () => { beforeEach(async() => { document.body.innerHTML = '' await window.happyDOM.whenAsyncComplete() diff --git a/examples/puppeteer/test/basic.test.ts b/examples/puppeteer/test/basic.test.ts index fd6abbcc98ef..4a776703b1a2 100644 --- a/examples/puppeteer/test/basic.test.ts +++ b/examples/puppeteer/test/basic.test.ts @@ -4,7 +4,7 @@ import type { PreviewServer } from 'vite' import puppeteer from 'puppeteer' import type { Browser, Page } from 'puppeteer' -describe('basic', async() => { +describe('basic', () => { let server: PreviewServer let browser: Browser let page: Page diff --git a/examples/react-testing-lib/src/components/input.test.tsx b/examples/react-testing-lib/src/components/input.test.tsx index 9ed1c72a78b7..51179878cf96 100644 --- a/examples/react-testing-lib/src/components/input.test.tsx +++ b/examples/react-testing-lib/src/components/input.test.tsx @@ -2,7 +2,7 @@ import '@testing-library/jest-dom' import { render, screen, userEvent } from '../utils/test-utils' import { Input } from './Input' -describe('Input', async() => { +describe('Input', () => { it('should render the input', () => { render( (name: T, ...fn: SuiteHooks[T]) => void } -export type SuiteFactory = (test: (name: string, fn: TestFunction) => void) => Awaitable +export type SuiteFactory = (test: (name: string, fn: TestFunction) => void) => void export interface RuntimeContext { tasks: (SuiteCollector | Test)[] diff --git a/test/fails/test/runner.test.ts b/test/fails/test/runner.test.ts index 04a17e07f8cb..1a66b5526596 100644 --- a/test/fails/test/runner.test.ts +++ b/test/fails/test/runner.test.ts @@ -3,9 +3,9 @@ import fg from 'fast-glob' import { execa } from 'execa' import { describe, expect, it } from 'vitest' -describe('should fails', async() => { +describe('should fails', () => { const root = resolve(__dirname, '../fixtures') - const files = await fg('*.test.ts', { cwd: root }) + const files = fg.sync('*.test.ts', { cwd: root }) for (const file of files) { it(file, async() => {