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

Function runTests

test/e2e/middleware-trailing-slash/test/index.test.ts:26–492  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 })
25
26 function runTests() {
27 describe('with .html extension', () => {
28 it('should work when requesting the page directly', async () => {
29 const $ = await next.render$(
30 '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037.html'
31 )
32 expect($('#text').text()).toBe(
33 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037.html'
34 )
35 })
36
37 it('should work using browser', async () => {
38 const browser = await next.browser(
39 '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037.html'
40 )
41 expect(await browser.elementByCss('#text').text()).toBe(
42 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037.html'
43 )
44 })
45
46 it('should work when navigating', async () => {
47 const browser = await next.browser('/html-links')
48 await browser.elementByCss('#with-html').click()
49 expect(await browser.waitForElementByCss('#text').text()).toBe(
50 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037.html'
51 )
52 })
53 })
54
55 describe('without .html extension', () => {
56 it('should work when requesting the page directly', async () => {
57 const $ = await next.render$(
58 '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037'
59 )
60 expect($('#text').text()).toBe(
61 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037'
62 )
63 })
64
65 it('should work using browser', async () => {
66 const browser = await next.browser(
67 '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037'
68 )
69 expect(await browser.elementByCss('#text').text()).toBe(
70 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037'
71 )
72 })
73
74 it('should work when navigating', async () => {
75 const browser = await next.browser('/html-links')
76 await browser.elementByCss('#without-html').click()
77 expect(await browser.waitForElementByCss('#text').text()).toBe(
78 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037'
79 )
80 })
81 })
82
83 if ((global as any).isNextDev) {

Callers 1

index.test.tsFile · 0.70

Calls 15

joinFunction · 0.90
waitForFunction · 0.90
fetchViaHTTPFunction · 0.90
checkFunction · 0.90
describeFunction · 0.85
webdriverFunction · 0.85
render$Method · 0.80
browserMethod · 0.80
elementByCssMethod · 0.80
clickMethod · 0.80
waitForElementByCssMethod · 0.80
evalMethod · 0.80

Tested by

no test coverage detected