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

Function runTests

test/integration/next-dynamic/test/index.test.ts:21–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19const appDir = join(__dirname, '../')
20
21function runTests() {
22 it('should render server value', async () => {
23 const html = await renderViaHTTP(appPort, '/')
24 expect(html).toMatch(/the-server-value/i)
25 })
26
27 it('should render dynamic server rendered values on client mount', async () => {
28 const browser = await webdriver(appPort, '/')
29 const text = await browser.elementByCss('#first-render').text()
30
31 // Failure case is 'Index<!-- -->3<!-- --><!-- -->'
32 expect(text).toMatch(
33 /^Index<!--\/?(\$|\s)-->1(<!--\/?(\$|\s)-->)+2(<!--\/?(\$|\s)-->)+3(<!--\/?(\$|\s)-->)+4(<!--\/?(\$|\s)-->)+4$/
34 )
35 expect(await browser.eval('window.caughtErrors')).toBe('')
36
37 // should not print "invalid-dynamic-suspense" warning in browser's console
38 const logs = (await browser.log()).map((log) => log.message).join('\n')
39 expect(logs).not.toContain(
40 'https://nextjs.org/docs/messages/invalid-dynamic-suspense'
41 )
42 })
43}
44
45describe('next/dynamic', () => {
46 ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(

Callers 1

index.test.tsFile · 0.70

Calls 10

renderViaHTTPFunction · 0.90
webdriverFunction · 0.85
elementByCssMethod · 0.80
evalMethod · 0.80
textMethod · 0.65
itFunction · 0.50
expectFunction · 0.50
joinMethod · 0.45
mapMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected