Skip to content

Commit f839747

Browse files
committed
chore: fix config types
1 parent 335600d commit f839747

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/PlaywrightEnvironment.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {
88
Page,
99
} from 'playwright-core'
1010
import { Event } from 'jest-circus'
11+
import type { JestEnvironmentConfig } from '@jest/environment'
1112
import type {
1213
BrowserType,
1314
ConfigDeviceType,
@@ -114,9 +115,9 @@ export const getPlaywrightEnv = (basicEnv = 'node'): unknown => {
114115
readonly _config: JestPlaywrightProjectConfig
115116
_jestPlaywrightConfig!: JestPlaywrightConfig
116117

117-
constructor(config: JestPlaywrightProjectConfig) {
118+
constructor(config: JestEnvironmentConfig) {
118119
super(config)
119-
this._config = config.projectConfig
120+
this._config = config.projectConfig as JestPlaywrightProjectConfig
120121
}
121122

122123
_getContextOptions(devices: Playwright['devices']): BrowserContextOptions {

types/global.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ export interface JestPlaywrightConfig {
228228
collectCoverage?: boolean
229229
}
230230

231-
export type JestPlaywrightProjectConfig = (
232-
| Test['context']['config']
233-
| JestConfig
234-
) & {
231+
export type JestPlaywrightProjectConfig = Test['context']['config'] & {
235232
browserName: BrowserType
236233
wsEndpoint: WsEndpointType
237234
device: DeviceType

0 commit comments

Comments
 (0)