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

Function runTests

test/e2e/optimized-loading/test/index.test.ts:11–29  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

9 })
10
11 function runTests(url) {
12 describe('page ' + url, () => {
13 it(`should render the page ${url}`, async () => {
14 const html = await next.render(url)
15 expect(html).toMatch(/Hello World/)
16 })
17
18 it('should not have JS preload links', async () => {
19 const $ = await next.render$(url)
20 expect($('link[rel=preload]').length).toBe(0)
21 })
22
23 it('should load scripts with defer in head', async () => {
24 const $ = await next.render$(url)
25 expect($('script[async]').length).toBe(0)
26 expect($('head script[defer]').length).toBeGreaterThan(0)
27 })
28 })
29 }
30
31 runTests('/')
32 runTests('/page1')

Callers 1

index.test.tsFile · 0.70

Calls 6

describeFunction · 0.85
render$Method · 0.80
renderMethod · 0.65
itFunction · 0.50
expectFunction · 0.50
$Function · 0.50

Tested by

no test coverage detected