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'
import webdriver from 'next-webdriver'
import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
import { fetchViaHTTP } from 'next-test-utils'
import { check, fetchViaHTTP } from 'next-test-utils'
describe.each([
['dev', false],
......@@ -46,21 +46,11 @@ describe.each([
// Compile /_error
await fetchViaHTTP(next.url, '/404')
try {
// Try 4 times to be sure there is no mismatch
expect(await matchLogs$(browser)).toBe(false)
await check(async () => {
await browser.refresh()
expect(await matchLogs$(browser)).toBe(false)
await browser.refresh()
expect(await matchLogs$(browser)).toBe(false)
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)
}
const foundLog = await matchLogs$(browser)
return foundLog ? 'success' : await browser.log('browser')
}, 'success')
} finally {
if (browser) {
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