Fix SeleniumStandalone import (#9338) (#9339)

This commit is contained in:
Diazole 2022-12-07 07:50:07 +00:00 committed by GitHub
parent b93651a24e
commit d5718054c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

@ -1,7 +1,13 @@
import { vi } from 'vitest'
export const install = vi.fn(() => new Promise<void>((resolve) => resolve()))
export const start = vi.fn(() => new Promise((resolve) => resolve({
kill : vi.fn(),
stdout : { pipe: vi.fn().mockReturnValue({ pipe : vi.fn() }) },
stderr : { pipe: vi.fn().mockReturnValue({ pipe : vi.fn() }) }
const install = vi.fn(() => new Promise<void>((resolve) => resolve()))
const start = vi.fn(() => new Promise((resolve) => resolve({
kill: vi.fn(),
stdout: { pipe : vi.fn().mockReturnValue({ pipe : vi.fn() }) },
stderr: { pipe : vi.fn().mockReturnValue({ pipe : vi.fn() }) }
})))
export default {
install,
start
}

View file

@ -6,7 +6,7 @@ import logger from '@wdio/logger'
import { isCloudCapability } from '@wdio/config'
import type { Capabilities, Options, Services } from '@wdio/types'
import * as SeleniumStandalone from 'selenium-standalone'
import SeleniumStandalone from 'selenium-standalone'
import { getFilePath, hasCapsWithSupportedBrowser } from './utils.js'
import type { SeleniumStandaloneOptions } from './types'

View file

@ -1,6 +1,6 @@
import path from 'node:path'
import fs from 'node:fs'
import * as SeleniumStandalone from 'selenium-standalone'
import SeleniumStandalone from 'selenium-standalone'
import { describe, expect, test, vi, beforeEach } from 'vitest'
import SeleniumStandaloneLauncher from '../src/launcher.js'