(pathname)
| 35 | } |
| 36 | |
| 37 | const didPrefetch = async (pathname) => { |
| 38 | const browser = await webdriver(appPort, pathname) |
| 39 | |
| 40 | let chunk = getClientBuildManifestLoaderChunkUrlPath(appDir, '/') |
| 41 | |
| 42 | await retry(async () => { |
| 43 | const links = await browser.elementsByCss('link[rel=prefetch]') |
| 44 | |
| 45 | const hrefs = await Promise.all( |
| 46 | links.map((link) => link.getAttribute('href')) |
| 47 | ) |
| 48 | |
| 49 | expect(hrefs).toEqual( |
| 50 | expect.arrayContaining([expect.stringContaining(chunk)]) |
| 51 | ) |
| 52 | }) |
| 53 | |
| 54 | await browser.close() |
| 55 | } |
| 56 | |
| 57 | function runCommonTests() { |
| 58 | // See https://github.com/vercel/next.js/issues/18437 |
no test coverage detected