Unverified Commit d97d045d authored by Jan Potoms's avatar Jan Potoms Committed by GitHub

Stabilize another test (#15697)

Saw this one fail on azure
parent 766fef22
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
launchApp, launchApp,
killApp, killApp,
waitFor, waitFor,
check,
} from 'next-test-utils' } from 'next-test-utils'
jest.setTimeout(1000 * 60 * 2) jest.setTimeout(1000 * 60 * 2)
...@@ -49,6 +50,7 @@ describe('Empty Project', () => { ...@@ -49,6 +50,7 @@ describe('Empty Project', () => {
it('should show empty object warning during client transition', async () => { it('should show empty object warning during client transition', async () => {
const browser = await webdriver(appPort, '/static') const browser = await webdriver(appPort, '/static')
try {
await browser.eval(`(function() { await browser.eval(`(function() {
window.gotWarn = false window.gotWarn = false
const origWarn = console.warn const origWarn = console.warn
...@@ -60,9 +62,12 @@ describe('Empty Project', () => { ...@@ -60,9 +62,12 @@ describe('Empty Project', () => {
} }
window.next.router.replace('/another') window.next.router.replace('/another')
})()`) })()`)
await waitFor(1000) await check(async () => {
const gotWarn = await browser.eval(`window.gotWarn`) const gotWarn = await browser.eval(`window.gotWarn`)
expect(gotWarn).toBe(true) return gotWarn ? 'pass' : 'fail'
}, 'pass')
} finally {
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