|
1 | 1 | import { nextTestSetup } from 'e2e-utils'
|
2 | 2 |
|
3 |
| -const WITH_PPR = !!process.env.__NEXT_EXPERIMENTAL_PPR |
4 |
| - |
5 | 3 | const stackStart = /\s+at /
|
6 | 4 |
|
7 | 5 | function createExpectError(cliOutput: string) {
|
@@ -205,16 +203,10 @@ function runTests(options: { withMinification: boolean }) {
|
205 | 203 | throw new Error('expected build not to fail for fully static project')
|
206 | 204 | }
|
207 | 205 |
|
208 |
| - if (WITH_PPR) { |
209 |
| - expect(next.cliOutput).toContain('◐ / ') |
210 |
| - const $ = await next.render$('/') |
211 |
| - expect($('#dynamic').text()).toBe('Dynamic') |
212 |
| - expect($('[data-fallback]').length).toBe(1) |
213 |
| - } else { |
214 |
| - expect(next.cliOutput).toContain('ƒ / ') |
215 |
| - const $ = await next.render$('/') |
216 |
| - expect($('#dynamic').text()).toBe('Dynamic') |
217 |
| - } |
| 206 | + expect(next.cliOutput).toContain('◐ / ') |
| 207 | + const $ = await next.render$('/') |
| 208 | + expect($('#dynamic').text()).toBe('Dynamic') |
| 209 | + expect($('[data-fallback]').length).toBe(1) |
218 | 210 | })
|
219 | 211 | })
|
220 | 212 |
|
@@ -379,16 +371,11 @@ function runTests(options: { withMinification: boolean }) {
|
379 | 371 | // Turbopack doesn't support disabling minification yet
|
380 | 372 | withMinification || isTurbopack ? undefined : 'IndirectionTwo'
|
381 | 373 | )
|
382 |
| - if (WITH_PPR) { |
383 |
| - // React currently fatals the render in canary because we don't have access to the prerender API there. with a fatal only |
384 |
| - // one task actually reports and error at the moment. We should fix upstream but for now we exclude the second error when PPR is off |
385 |
| - // because we are using canary React and renderToReadableStream rather than experimental React and prerender |
386 |
| - expectError( |
387 |
| - 'Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it.', |
388 |
| - // Turbopack doesn't support disabling minification yet |
389 |
| - withMinification || isTurbopack ? undefined : 'IndirectionThree' |
390 |
| - ) |
391 |
| - } |
| 374 | + expectError( |
| 375 | + 'Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it.', |
| 376 | + // Turbopack doesn't support disabling minification yet |
| 377 | + withMinification || isTurbopack ? undefined : 'IndirectionThree' |
| 378 | + ) |
392 | 379 | expectError('Error occurred prerendering page "/"')
|
393 | 380 | expectError('exiting the build.')
|
394 | 381 | })
|
@@ -421,36 +408,18 @@ function runTests(options: { withMinification: boolean }) {
|
421 | 408 | }
|
422 | 409 | })
|
423 | 410 |
|
424 |
| - if (WITH_PPR) { |
425 |
| - it('should partially prerender when all dynamic components are inside a Suspense boundary', async () => { |
426 |
| - try { |
427 |
| - await next.start() |
428 |
| - } catch { |
429 |
| - throw new Error( |
430 |
| - 'expected build not to fail for fully static project' |
431 |
| - ) |
432 |
| - // we expect the build to fail |
433 |
| - } |
434 |
| - |
435 |
| - expect(next.cliOutput).toContain('◐ / ') |
436 |
| - const $ = await next.render$('/') |
437 |
| - expect($('[data-fallback]').length).toBe(2) |
438 |
| - }) |
439 |
| - } else { |
440 |
| - it('should not error the build when all dynamic components are inside a Suspense boundary', async () => { |
441 |
| - try { |
442 |
| - await next.start() |
443 |
| - } catch { |
444 |
| - throw new Error( |
445 |
| - 'expected build not to fail for fully static project' |
446 |
| - ) |
447 |
| - } |
| 411 | + it('should partially prerender when all dynamic components are inside a Suspense boundary', async () => { |
| 412 | + try { |
| 413 | + await next.start() |
| 414 | + } catch { |
| 415 | + throw new Error('expected build not to fail for fully static project') |
| 416 | + // we expect the build to fail |
| 417 | + } |
448 | 418 |
|
449 |
| - expect(next.cliOutput).toContain('ƒ / ') |
450 |
| - const $ = await next.render$('/') |
451 |
| - expect($('[data-fallback]').length).toBe(2) |
452 |
| - }) |
453 |
| - } |
| 419 | + expect(next.cliOutput).toContain('◐ / ') |
| 420 | + const $ = await next.render$('/') |
| 421 | + expect($('[data-fallback]').length).toBe(2) |
| 422 | + }) |
454 | 423 | })
|
455 | 424 | })
|
456 | 425 | }
|
|
0 commit comments