()
| 34 | await browser.waitForCondition('!!window.next.router.isReady') |
| 35 | |
| 36 | const getCacheKeys = async () => { |
| 37 | return (await browser.eval('Object.keys(window.next.router.sdc)')) |
| 38 | .map((key) => { |
| 39 | // strip http://localhost:PORT |
| 40 | // and then strip buildId prefix |
| 41 | return key |
| 42 | .substring(key.indexOf('/_next')) |
| 43 | .replace(/\/_next\/data\/(.*?)\//, '/_next/data/BUILD_ID/') |
| 44 | }) |
| 45 | .sort() |
| 46 | } |
| 47 | |
| 48 | const cacheKeys = await getCacheKeys() |
| 49 | expect(cacheKeys).toEqual( |