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

Function runTests

test/integration/auto-export/test/index.test.ts:18–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16let app
17
18const runTests = () => {
19 it('Supports commonjs 1', async () => {
20 const browser = await webdriver(appPort, '/commonjs1')
21 const html = await browser.eval('document.body.innerHTML')
22 expect(html).toMatch(/test1/)
23 expect(html).toMatch(/nextExport/)
24 await browser.close()
25 })
26
27 it('Supports commonjs 2', async () => {
28 const browser = await webdriver(appPort, '/commonjs2')
29 const html = await browser.eval('document.body.innerHTML')
30 expect(html).toMatch(/test2/)
31 expect(html).toMatch(/nextExport/)
32 await browser.close()
33 })
34
35 it('Refreshes query on mount', async () => {
36 const browser = await webdriver(appPort, '/post-1')
37 await check(() => browser.eval('document.body.innerHTML'), /post.*post-1/)
38 const html = await browser.eval('document.body.innerHTML')
39 expect(html).toMatch(/nextExport/)
40 })
41
42 it('should update asPath after mount', async () => {
43 const browser = await webdriver(appPort, '/zeit/cmnt-2')
44 await check(
45 () => browser.eval(`document.documentElement.innerHTML`),
46 /\/zeit\/cmnt-2/
47 )
48 })
49
50 it('should not replace URL with page name while asPath is delayed', async () => {
51 const browser = await webdriver(appPort, '/zeit/cmnt-1')
52 const val = await browser.eval(`!!window.pathnames.find(function(p) {
53 return p !== '/zeit/cmnt-1'
54 })`)
55 expect(val).toBe(false)
56 })
57}
58
59describe('Auto Export', () => {
60 ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(

Callers 1

index.test.tsFile · 0.70

Calls 6

checkFunction · 0.90
webdriverFunction · 0.85
evalMethod · 0.80
closeMethod · 0.65
itFunction · 0.50
expectFunction · 0.50

Tested by

no test coverage detected