Unverified Commit d40daaa1 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update flakey styled-components test (#44613)

x-ref:
https://github.com/vercel/next.js/actions/runs/3850826647/jobs/6561463849
parent 5f2c9d0b
...@@ -2,7 +2,7 @@ import { join } from 'path' ...@@ -2,7 +2,7 @@ import { join } from 'path'
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
import { createNext, FileRef } from 'e2e-utils' import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base' import { NextInstance } from 'test/lib/next-modes/base'
import { fetchViaHTTP } from 'next-test-utils' import { check, fetchViaHTTP } from 'next-test-utils'
describe.each([ describe.each([
['dev', false], ['dev', false],
...@@ -46,21 +46,11 @@ describe.each([ ...@@ -46,21 +46,11 @@ describe.each([
// Compile /_error // Compile /_error
await fetchViaHTTP(next.url, '/404') await fetchViaHTTP(next.url, '/404')
try { await check(async () => {
// Try 4 times to be sure there is no mismatch
expect(await matchLogs$(browser)).toBe(false)
await browser.refresh() await browser.refresh()
expect(await matchLogs$(browser)).toBe(false) const foundLog = await matchLogs$(browser)
await browser.refresh() return foundLog ? 'success' : await browser.log('browser')
expect(await matchLogs$(browser)).toBe(false) }, 'success')
await browser.refresh()
expect(await matchLogs$(browser)).toBe(false)
throw new Error('did not find mismatch')
} catch (err) {
// Verify that it really has the logs
// eslint-disable-next-line jest/no-try-expect
expect(await matchLogs$(browser)).toBe(true)
}
} finally { } finally {
if (browser) { if (browser) {
await browser.close() await browser.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment