mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
fix: re-export CDP Session directly from playwright (#8702)
This commit is contained in:
parent
91c7e5f926
commit
9553ab9234
@ -60,7 +60,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"playwright": "^1.55.0",
|
||||
"playwright-core": "^1.55.0",
|
||||
"vitest": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ const external = [
|
||||
...Object.keys(pkg.peerDependencies || {}),
|
||||
/^@?vitest(\/|$)/,
|
||||
'vite',
|
||||
'playwright-core/types/protocol',
|
||||
]
|
||||
|
||||
const dtsUtils = createDtsUtils()
|
||||
|
||||
@ -10,8 +10,8 @@ import type {
|
||||
FrameLocator,
|
||||
LaunchOptions,
|
||||
Page,
|
||||
CDPSession as PlaywrightCDPSession,
|
||||
} from 'playwright'
|
||||
import type { Protocol } from 'playwright-core/types/protocol'
|
||||
import type { SourceMap } from 'rollup'
|
||||
import type { ResolvedConfig } from 'vite'
|
||||
import type {
|
||||
@ -570,6 +570,8 @@ type PWScreenshotOptions = NonNullable<Parameters<Page['screenshot']>[0]>
|
||||
type PWSelectOptions = NonNullable<Parameters<Page['selectOption']>[2]>
|
||||
type PWDragAndDropOptions = NonNullable<Parameters<Page['dragAndDrop']>[2]>
|
||||
type PWSetInputFiles = NonNullable<Parameters<Page['setInputFiles']>[2]>
|
||||
// Must be re-aliased here or rollup-plugin-dts removes the import alias and you end up with a circular reference
|
||||
type PWCDPSession = PlaywrightCDPSession
|
||||
|
||||
declare module 'vitest/browser' {
|
||||
export interface UserEventHoverOptions extends PWHoverOptions {}
|
||||
@ -585,22 +587,5 @@ declare module 'vitest/browser' {
|
||||
mask?: ReadonlyArray<Element | Locator> | undefined
|
||||
}
|
||||
|
||||
export interface CDPSession {
|
||||
send<T extends keyof Protocol.CommandParameters>(
|
||||
method: T,
|
||||
params?: Protocol.CommandParameters[T]
|
||||
): Promise<Protocol.CommandReturnValues[T]>
|
||||
on<T extends keyof Protocol.Events>(
|
||||
event: T,
|
||||
listener: (payload: Protocol.Events[T]) => void
|
||||
): this
|
||||
once<T extends keyof Protocol.Events>(
|
||||
event: T,
|
||||
listener: (payload: Protocol.Events[T]) => void
|
||||
): this
|
||||
off<T extends keyof Protocol.Events>(
|
||||
event: T,
|
||||
listener: (payload: Protocol.Events[T]) => void
|
||||
): this
|
||||
}
|
||||
export interface CDPSession extends PWCDPSession {}
|
||||
}
|
||||
|
||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -512,9 +512,6 @@ importers:
|
||||
playwright:
|
||||
specifier: ^1.55.0
|
||||
version: 1.55.0
|
||||
playwright-core:
|
||||
specifier: ^1.55.0
|
||||
version: 1.55.0
|
||||
vitest:
|
||||
specifier: workspace:*
|
||||
version: link:../vitest
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user