MCPcopy
hub / github.com/vercel/next.js / runTests

Function runTests

test/integration/route-load-cancel-css/test/index.test.ts:18–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16const appDir = join(__dirname, '../')
17
18function runTests() {
19 it('should cancel slow page loads on re-navigation', async () => {
20 const browser = await webdriver(appPort, '/')
21
22 await browser.elementByCss('#link-1').click()
23 await waitFor(3000)
24 expect(await browser.hasElementByCssSelector('#page-text')).toBeFalsy()
25
26 await browser.elementByCss('#link-2').click()
27 await waitFor(3000)
28
29 const text2 = await browser.elementByCss('#page-text').text()
30 expect(text2).toMatch(/2/)
31 expect(await browser.eval('window.routeCancelled')).toBe('yes')
32 })
33}
34
35describe('route cancel via CSS', () => {
36 ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(

Callers 1

index.test.tsFile · 0.70

Calls 9

waitForFunction · 0.90
webdriverFunction · 0.85
clickMethod · 0.80
elementByCssMethod · 0.80
evalMethod · 0.80
textMethod · 0.65
itFunction · 0.50
expectFunction · 0.50

Tested by

no test coverage detected