Skip to content

Commit 579bda9

Browse files
authored
fix(browser): fix provider options types (#7115)
1 parent 843a621 commit 579bda9

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

packages/browser/providers/playwright.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import type {
99
} from 'playwright'
1010
import { Protocol } from 'playwright-core/types/protocol'
1111
import '../matchers.js'
12+
import type {} from "vitest/node"
1213

1314
declare module 'vitest/node' {
14-
interface BrowserProviderOptions {
15+
export interface BrowserProviderOptions {
1516
launch?: LaunchOptions
1617
context?: Omit<
1718
BrowserContextOptions,

packages/browser/providers/webdriverio.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { RemoteOptions, ClickOptions, DragAndDropOptions } from 'webdriverio'
22
import '../matchers.js'
3+
import type {} from "vitest/node"
34

45
declare module 'vitest/node' {
5-
interface BrowserProviderOptions extends Partial<RemoteOptions> {}
6+
export interface BrowserProviderOptions extends Partial<RemoteOptions> {}
67

78
export interface UserEventClickOptions extends ClickOptions {}
89

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference types="@vitest/browser/providers/playwright" />
21
import { page, userEvent } from '@vitest/browser/context'
32
import { test } from 'vitest'
43

test/dts-playwright/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
"target": "ESNext",
44
"module": "ESNext",
55
"moduleResolution": "Bundler",
6+
"types": ["@vitest/browser/providers/playwright"],
67
"strict": true,
78
"noEmit": true
89
},
9-
"include": ["src"]
10+
"include": ["src", "*.ts"]
1011
}

test/dts-playwright/vite.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from 'vitest/config'
2+
3+
export default defineConfig({
4+
test: {
5+
browser: {
6+
provider: 'playwright',
7+
providerOptions: {
8+
launch: {
9+
timeout: 1234,
10+
// @ts-expect-error test type error
11+
slowMo: 'wrong',
12+
},
13+
},
14+
instances: [
15+
{
16+
browser: 'chromium',
17+
launch: {
18+
timeout: 1234,
19+
// @ts-expect-error test type error
20+
slowMo: 'wrong',
21+
},
22+
},
23+
],
24+
},
25+
},
26+
})

0 commit comments

Comments
 (0)