Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(browser): fix matchers.d.ts #6995

Merged
merged 9 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"]
}