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

Function getCacheKeys

test/integration/dynamic-routing/test/index.test.ts:36–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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(

Callers 1

runTestsFunction · 0.85

Calls 5

evalMethod · 0.80
replaceMethod · 0.65
sortMethod · 0.45
mapMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected