Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions packages/browser/matchers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@ import type { TestingLibraryMatchers } from './jest-dom.js'
import type { Assertion, ExpectPollOptions } from 'vitest'

declare module 'vitest' {
interface JestAssertion<T = any> extends TestingLibraryMatchers<void, T> {}
Copy link
Author

@samchungy samchungy Jul 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically breaking but this aligns more with how Jest works and makes more sense?

See: https://github.com/vitest-dev/vitest/pull/8266/files#diff-810c1bb9ffac48cfe14f7dbbaf10fdf5725e06feecb99c657d49f3c7712bcd00L197-R197

image

I think we may be incorrectly setting these as it seems like the intention is for void to be R and T to be set to E here.

interface AsymmetricMatchersContaining extends TestingLibraryMatchers<void, void> {}
interface JestAssertion<T = any, R = void> extends TestingLibraryMatchers<T, R> {}
interface AsymmetricMatchersContaining<T = any, R = void> extends TestingLibraryMatchers<T, R> {}

type Promisify<O> = {
[K in keyof O]: O[K] extends (...args: infer A) => infer R
? O extends R
? Promisify<O[K]>
: (...args: A) => Promise<R>
: O[K];
}

type PromisifyDomAssertion<T> = Promisify<Assertion<T>>
type PromisifyDomAssertion<T> = Assertion<T, Promise<void>>

interface ExpectStatic {
/**
Expand Down
Loading
Loading