diff --git a/packages/browser/jest-dom.d.ts b/packages/browser/jest-dom.d.ts index ff0a540d7186..c4316db82bed 100644 --- a/packages/browser/jest-dom.d.ts +++ b/packages/browser/jest-dom.d.ts @@ -260,8 +260,8 @@ declare namespace matchers { * @see * [testing-library/jest-dom#tohaveclass](https://github.com/testing-library/jest-dom#tohaveclass) */ - toHaveClass(...classNames: Array): R toHaveClass(classNames: string, options?: {exact: boolean}): R + toHaveClass(...classNames: Array): R /** * @description * This allows you to check whether the given form element has the specified displayed value (the one the diff --git a/packages/browser/utils.d.ts b/packages/browser/utils.d.ts index 81fb50bf0c6d..9a78b236f43b 100644 --- a/packages/browser/utils.d.ts +++ b/packages/browser/utils.d.ts @@ -2,7 +2,7 @@ // we cannot bundle it because vitest depend on the @vitest/browser and vise versa // fortunately, the file is quite small -import { LocatorSelectors } from '@vitest/browser/context' +import { LocatorSelectors, Locator } from '@vitest/browser/context' import { StringifyOptions } from 'vitest/utils' export type PrettyDOMOptions = Omit diff --git a/packages/vitest/package.json b/packages/vitest/package.json index 532352e5dadf..9b66f56afd78 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -123,6 +123,7 @@ }, "peerDependencies": { "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "@vitest/browser": "workspace:*", "@vitest/ui": "workspace:*", @@ -133,6 +134,9 @@ "@edge-runtime/vm": { "optional": true }, + "@types/debug": { + "optional": true + }, "@types/node": { "optional": true }, diff --git a/packages/vitest/src/utils/debugger.ts b/packages/vitest/src/utils/debugger.ts index 473030ff57ce..2defeed44584 100644 --- a/packages/vitest/src/utils/debugger.ts +++ b/packages/vitest/src/utils/debugger.ts @@ -1,6 +1,7 @@ +import type { Debugger } from 'debug' import createDebug from 'debug' -export function createDebugger(namespace: `vitest:${string}`) { +export function createDebugger(namespace: `vitest:${string}`): Debugger | undefined { const debug = createDebug(namespace) if (debug.enabled) { return debug