Skip to content

Commit

Permalink
Update error-load-fail test to use check to handle reload taking long…
Browse files Browse the repository at this point in the history
…er on windows (#10631)

* Update error-load-fail test to use check to handle reload taking longer on windows

* bump
  • Loading branch information
ijjk committed Feb 21, 2020
1 parent fb72982 commit 830090a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions test/integration/error-load-fail/test/index.test.js
Expand Up @@ -2,13 +2,7 @@
/* global jasmine */
import path from 'path'
import webdriver from 'next-webdriver'
import {
nextBuild,
nextStart,
findPort,
killApp,
waitFor,
} from 'next-test-utils'
import { nextBuild, nextStart, findPort, killApp, check } from 'next-test-utils'

jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1
const appDir = path.join(__dirname, '..')
Expand All @@ -29,8 +23,11 @@ describe('Failing to load _error', () => {
await killApp(app)

await browser.elementByCss('#to-broken').click()
await waitFor(2000)

expect(await browser.eval('window.beforeNavigate')).toBeFalsy()
await check(async () => {
return !(await browser.eval('window.beforeNavigate'))
? 'reloaded'
: 'fail'
}, /reloaded/)
})
})

0 comments on commit 830090a

Please sign in to comment.