Skip to content

Commit

Permalink
fix: proper vitest ts support (testing-library#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyaapass committed Mar 11, 2024
1 parent a93c0c4 commit 805ac1c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions types/vitest.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import {type expect} from 'vitest'
/* eslint-disable @typescript-eslint/no-shadow */

import {type Assertion, type AsymmetricMatchersContaining} from 'vitest'
import {type TestingLibraryMatchers} from './matchers'

export {}
declare module '@vitest/expect' {
interface JestAssertion<T = any>

// https://vitest.dev/guide/extending-matchers.html
declare module 'vitest' {
interface Assertion<T = any>
extends TestingLibraryMatchers<
ReturnType<typeof expect.stringContaining>,
T
> {}
interface AsymmetricMatchersContaining extends TestingLibraryMatchers {}
}

0 comments on commit 805ac1c

Please sign in to comment.