Skip to content

Commit

Permalink
chore: bump playwright-chromium for macos 12
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Mar 13, 2022
1 parent 97ee7e8 commit 2dd7406
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"minimist": "^1.2.5",
"nodemon": "^2.0.15",
"optionator": "^0.9.1",
"playwright-chromium": "^1.12.3",
"playwright-chromium": "^1.19.2",
"prettier": "^2.3.2",
"prettier-plugin-svelte": "^2.6.0",
"prompts": "^2.4.1",
Expand Down
17 changes: 9 additions & 8 deletions packages/vite-plugin-checker/__tests__/e2e/Sandbox/Sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import execa from 'execa'
import path from 'path'
import playwright from 'playwright-chromium'
import strip from 'strip-ansi'
import invariant from 'tiny-invariant'
import { build, createServer, HMRPayload, ViteDevServer, CustomPayload } from 'vite'
import { createServer, ViteDevServer, CustomPayload } from 'vite'
import { Checker } from 'vite-plugin-checker'

import { expectStdoutNotContains, expectStderrContains, sleep, testDir } from '../testUtils'

import type { ElementHandleForTag } from 'playwright-chromium/types/structs'
import type { ElementHandle } from 'playwright-chromium'
let devServer: ViteDevServer
let binPath: string
export let log = ''
Expand Down Expand Up @@ -110,23 +109,25 @@ export async function pollingUntil<T>(poll: () => Promise<T>, until: (actual: T)
}
}

export async function waitForHmrOverlay() {
export async function waitForHmrOverlay(): Promise<
ElementHandle<'vite-plugin-checker-error-overlay'>
> {
const element = await page.waitForSelector('vite-plugin-checker-error-overlay', {
state: 'attached',
})
return element
}

export async function getHmrOverlay() {
export async function getHmrOverlay(): Promise<ElementHandle<'vite-plugin-checker-error-overlay'> | null> {
const dom = await page.$('vite-plugin-checker-error-overlay')
if (dom) console.log('found vite-plugin-checker-error-overlay')
return dom
}

export async function getHmrOverlayText(
element?: ElementHandleForTag<'vite-plugin-checker-error-overlay'> | null
element?: ElementHandle<'vite-plugin-checker-error-overlay'> | null
) {
let shadowRoot: ElementHandleForTag<'vite-plugin-checker-error-overlay'> | undefined | null
let shadowRoot: ElementHandle<'vite-plugin-checker-error-overlay'> | undefined | null
if (element) {
shadowRoot = element
} else {
Expand Down Expand Up @@ -174,7 +175,7 @@ export async function viteBuild({
await promise
throw new Error('Fail! Should failed with error message')
} catch (e) {
expectStderrContains(e.toString(), expectedErrorMsg)
expectStderrContains((e as any).toString(), expectedErrorMsg)
}
return
}
Expand Down
127 changes: 97 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2dd7406

Please sign in to comment.