diff --git a/packages/vitest/globals.d.ts b/packages/vitest/globals.d.ts index c1096c5501ec..6fd3cfd4cd98 100644 --- a/packages/vitest/globals.d.ts +++ b/packages/vitest/globals.d.ts @@ -13,5 +13,7 @@ declare global { const afterAll: typeof import('vitest')['afterAll'] const beforeEach: typeof import('vitest')['beforeEach'] const afterEach: typeof import('vitest')['afterEach'] + const onTestFailed: typeof import('vitest')['onTestFailed'] + const onTestFinished: typeof import('vitest')['onTestFinished'] } export {} diff --git a/packages/vitest/src/constants.ts b/packages/vitest/src/constants.ts index 87164b9a2b70..b82a3ec7034d 100644 --- a/packages/vitest/src/constants.ts +++ b/packages/vitest/src/constants.ts @@ -68,4 +68,6 @@ export const globalApis = [ 'afterAll', 'beforeEach', 'afterEach', + 'onTestFinished', + 'onTestFailed', ]