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

Function runTests

test/integration/router-is-ready/test/index.test.ts:29–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29function runTests() {
30 it('isReady should be true immediately for getInitialProps page', async () => {
31 const browser = await webdriver(appPort, '/gip')
32 await checkIsReadyValues(browser, [true])
33 })
34
35 it('isReady should be true immediately for getInitialProps page with query', async () => {
36 const browser = await webdriver(appPort, '/gip?hello=world')
37 await checkIsReadyValues(browser, [true])
38 })
39
40 it('isReady should be true immediately for getServerSideProps page', async () => {
41 const browser = await webdriver(appPort, '/gssp')
42 await checkIsReadyValues(browser, [true])
43 })
44
45 it('isReady should be true immediately for getServerSideProps page with query', async () => {
46 const browser = await webdriver(appPort, '/gssp?hello=world')
47 await checkIsReadyValues(browser, [true])
48 })
49
50 it('isReady should be true immediately for auto-export page without query', async () => {
51 const browser = await webdriver(appPort, '/auto-export')
52 await checkIsReadyValues(browser, [true])
53 })
54
55 it('isReady should be true after query update for auto-export page with query', async () => {
56 const browser = await webdriver(appPort, '/auto-export?hello=world')
57 await checkIsReadyValues(browser, [false, true])
58 })
59
60 it('isReady should be true after query update for dynamic auto-export page without query', async () => {
61 const browser = await webdriver(appPort, '/auto-export/first')
62 await checkIsReadyValues(browser, [false, true])
63 })
64
65 it('isReady should be true after query update for dynamic auto-export page with query', async () => {
66 const browser = await webdriver(appPort, '/auto-export/first?hello=true')
67 await checkIsReadyValues(browser, [false, true])
68 })
69
70 it('isReady should be true after query update for getStaticProps page with query', async () => {
71 const browser = await webdriver(appPort, '/gsp?hello=world')
72 await checkIsReadyValues(browser, [false, true])
73 })
74
75 it('isReady should be true immediately for getStaticProps page without query', async () => {
76 const browser = await webdriver(appPort, '/gsp')
77 await checkIsReadyValues(browser, [true])
78 })
79}
80
81describe('router.isReady', () => {
82 ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(

Callers 1

index.test.tsFile · 0.70

Calls 3

webdriverFunction · 0.85
checkIsReadyValuesFunction · 0.70
itFunction · 0.50

Tested by

no test coverage detected