Skip to content

Commit

Permalink
fix(types): fix public types (#7328)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir <[email protected]>
  • Loading branch information
mrginglymus and sheremet-va authored Jan 22, 2025
1 parent bff70be commit ce6af70
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/browser/jest-dom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ declare namespace matchers {
* @see
* [testing-library/jest-dom#tohaveclass](https://github.com/testing-library/jest-dom#tohaveclass)
*/
toHaveClass(...classNames: Array<string | RegExp>): R
toHaveClass(classNames: string, options?: {exact: boolean}): R
toHaveClass(...classNames: Array<string | RegExp>): R
/**
* @description
* This allows you to check whether the given form element has the specified displayed value (the one the
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<StringifyOptions, 'maxLength'>
Expand Down
4 changes: 4 additions & 0 deletions packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*",
Expand All @@ -133,6 +134,9 @@
"@edge-runtime/vm": {
"optional": true
},
"@types/debug": {
"optional": true
},
"@types/node": {
"optional": true
},
Expand Down
3 changes: 2 additions & 1 deletion packages/vitest/src/utils/debugger.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ce6af70

Please sign in to comment.