Stabilize another test (#15697)

Saw this one fail on azure
This commit is contained in:
Jan Potoms 2020-07-31 05:22:32 +02:00 committed by GitHub
parent 766fef2271
commit d97d045dfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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