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

Function getData

test/integration/prerender-preview/test/index.test.ts:25–35  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

23}
24
25function getData(html) {
26 const $ = cheerio.load(html)
27 const nextData = $('#__NEXT_DATA__')
28 const preEl = $('#props-pre')
29 const routerData = JSON.parse($('#router').text())
30 return {
31 nextData: JSON.parse(nextData.html()),
32 pre: preEl.text(),
33 routerData,
34 }
35}
36
37function runTests(startServer = nextStart) {
38 it('should compile successfully', async () => {

Callers 1

runTestsFunction · 0.70

Calls 4

loadMethod · 0.65
textMethod · 0.65
$Function · 0.50
parseMethod · 0.45

Tested by

no test coverage detected