Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Apr 7, 2023
1 parent e295cbe commit c458ba9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/vitest/src/node/browser/playwright.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Page } from 'playwright'
import type { BrowserProvider, BrowserProviderOptions } from '../../types/browser'
import { ensurePackageInstalled } from '../pkg'
import type { Vitest } from '../core'
import type { VitestWorkspace } from '../workspace'

export const playwrightBrowsers = ['firefox', 'webkit', 'chromium'] as const
export type PlaywrightBrowser = typeof playwrightBrowsers[number]
Expand All @@ -15,13 +15,13 @@ export class PlaywrightBrowserProvider implements BrowserProvider {

private cachedBrowser: Page | null = null
private browser!: PlaywrightBrowser
private ctx!: Vitest
private ctx!: VitestWorkspace

getSupportedBrowsers() {
return playwrightBrowsers
}

async initialize(ctx: Vitest, { browser }: PlaywrightProviderOptions) {
async initialize(ctx: VitestWorkspace, { browser }: PlaywrightProviderOptions) {
this.ctx = ctx
this.browser = browser

Expand Down
6 changes: 3 additions & 3 deletions packages/vitest/src/node/browser/webdriver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Browser } from 'webdriverio'
import type { BrowserProvider, BrowserProviderOptions } from '../../types/browser'
import { ensurePackageInstalled } from '../pkg'
import type { Vitest } from '../core'
import type { VitestWorkspace } from '../workspace'

export const webdriverBrowsers = ['firefox', 'chrome', 'edge', 'safari'] as const
export type WebdriverBrowser = typeof webdriverBrowsers[number]
Expand All @@ -16,13 +16,13 @@ export class WebdriverBrowserProvider implements BrowserProvider {
private cachedBrowser: Browser | null = null
private stopSafari: () => void = () => {}
private browser!: WebdriverBrowser
private ctx!: Vitest
private ctx!: VitestWorkspace

getSupportedBrowsers() {
return webdriverBrowsers
}

async initialize(ctx: Vitest, { browser }: WebdriverProviderOptions) {
async initialize(ctx: VitestWorkspace, { browser }: WebdriverProviderOptions) {
this.ctx = ctx
this.browser = browser

Expand Down
1 change: 1 addition & 0 deletions packages/vitest/src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type { Vitest } from './core'
export type { VitestWorkspace } from './workspace'
export { createVitest } from './create'
export { VitestPlugin } from './plugins'
export { startVitest } from './cli-api'
Expand Down

0 comments on commit c458ba9

Please sign in to comment.