Skip to content

Commit

Permalink
Fixes to check browsers for parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarkelov committed Mar 18, 2020
1 parent 7228fab commit c0109ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/bin/testProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ const exec = ({

const runner = async (sequence: string, params: string[]): Promise<void> => {
// TODO Work only if we pass config through package.json
const rootDir = process.env.npm_package_jest_rootDir
? `${process.cwd()}/${process.env.npm_package_jest_rootDir}/`
: process.cwd()
const rootDir = `${process.cwd()}/${process.env.npm_package_jest_rootDir ||
''}/`
const config = await readConfig(rootDir)
const { browsers = [], devices = [] } = config
const { devices = [] } = config
let browsers = config.browsers
if (!browsers) {
browsers = browser ? [browser] : []
}
let exitCodes: (number | null)[] = []
checkCommand(browsers, devices)
if (!browsers.length && devices.length) {
Expand Down
5 changes: 3 additions & 2 deletions types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Page, Browser, BrowserContext } from 'playwright-core'
import { Page, BrowserContext } from 'playwright-core'
import { BrowserType } from '../src/constants'

interface JestPlaywright {
/**
Expand All @@ -17,7 +18,7 @@ interface JestPlaywright {

declare global {
const page: Page
const browser: Browser
const browser: BrowserType
const context: BrowserContext
const jestPlaywright: JestPlaywright
}

0 comments on commit c0109ab

Please sign in to comment.