Skip to content

Commit

Permalink
fix(browser): fix matchers.d.ts (#6995)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Dec 1, 2024
1 parent a3bef59 commit a485b32
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ test/**/__screenshots__/**/*
test/browser/fixtures/update-snapshot/basic.test.ts
test/cli/fixtures/browser-multiple/basic-*
.vitest-reports
*.tsbuildinfo
2 changes: 1 addition & 1 deletion packages/browser/matchers.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Locator } from '@vitest/browser/context'
import type jsdomMatchers from './jest-dom.js'
import type { Assertion } from 'vitest'
import type { Assertion, ExpectPollOptions } from 'vitest'

declare module 'vitest' {
interface JestAssertion<T = any> extends jsdomMatchers.default.TestingLibraryMatchers<void, T> {}
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions test/dts-playwright/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@vitest/test-dts-playwright",
"type": "module",
"private": true,
"scripts": {
"test": "tsc -b"
},
"devDependencies": {
"@vitest/browser": "workspace:*",
"vitest": "workspace:*"
}
}
8 changes: 8 additions & 0 deletions test/dts-playwright/src/basic.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="@vitest/browser/providers/playwright" />
import { page, userEvent } from '@vitest/browser/context'
import { test } from 'vitest'

test('basic', async () => {
document.body.innerHTML = `<button>hello</button>`
await userEvent.click(page.getByRole('button'), { force: true })
})
10 changes: 10 additions & 0 deletions test/dts-playwright/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"noEmit": true
},
"include": ["src"]
}

0 comments on commit a485b32

Please sign in to comment.