[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

test: test hook cleanup timeout correctly (#7651)

authored by

Hiroshi Ogawa and committed by
GitHub
(Mar 11, 2025, 2:40 PM +0100) e4b34b81 20b39c41

+9 -5
+9 -5
test/cli/fixtures/fails/hooks-timeout-before-hook-cleanup-callback.test.ts
··· 1 - import { beforeEach, beforeAll, describe, test } from 'vitest'; 1 + import { beforeEach, beforeAll, describe, test, expect } from 'vitest'; 2 2 3 3 describe('beforeEach cleanup timeout', () => { 4 - beforeEach(() => new Promise(() => {}), 101) 5 - test("ok", () => {}) 4 + beforeEach(() => () => new Promise(() => {}), 101) 5 + test("ok", () => { 6 + expect(0).toBe(0) 7 + }) 6 8 }) 7 9 8 10 describe('beforeAll cleanup timeout', () => { 9 - beforeAll(() => new Promise(() => {}), 102) 10 - test("ok", () => {}) 11 + beforeAll(() => () => new Promise(() => {}), 102) 12 + test("ok", () => { 13 + expect(0).toBe(0) 14 + }) 11 15 })