parent
766fef2271
commit
d97d045dfc
1 changed files with 19 additions and 14 deletions
|
@ -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()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue