Skip to content

Commit a485b32

Browse files
authored
fix(browser): fix matchers.d.ts (#6995)
1 parent a3bef59 commit a485b32

File tree

6 files changed

+41
-1
lines changed

6 files changed

+41
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ test/**/__screenshots__/**/*
2828
test/browser/fixtures/update-snapshot/basic.test.ts
2929
test/cli/fixtures/browser-multiple/basic-*
3030
.vitest-reports
31+
*.tsbuildinfo

packages/browser/matchers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Locator } from '@vitest/browser/context'
22
import type jsdomMatchers from './jest-dom.js'
3-
import type { Assertion } from 'vitest'
3+
import type { Assertion, ExpectPollOptions } from 'vitest'
44

55
declare module 'vitest' {
66
interface JestAssertion<T = any> extends jsdomMatchers.default.TestingLibraryMatchers<void, T> {}

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/dts-playwright/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@vitest/test-dts-playwright",
3+
"type": "module",
4+
"private": true,
5+
"scripts": {
6+
"test": "tsc -b"
7+
},
8+
"devDependencies": {
9+
"@vitest/browser": "workspace:*",
10+
"vitest": "workspace:*"
11+
}
12+
}

test/dts-playwright/src/basic.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference types="@vitest/browser/providers/playwright" />
2+
import { page, userEvent } from '@vitest/browser/context'
3+
import { test } from 'vitest'
4+
5+
test('basic', async () => {
6+
document.body.innerHTML = `<button>hello</button>`
7+
await userEvent.click(page.getByRole('button'), { force: true })
8+
})

test/dts-playwright/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "ESNext",
5+
"moduleResolution": "Bundler",
6+
"strict": true,
7+
"noEmit": true
8+
},
9+
"include": ["src"]
10+
}

0 commit comments

Comments
 (0)