Skip to content

Commit ae884a8

Browse files
committed
Update tests
1 parent 0dc8de8 commit ae884a8

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

test/development/app-dir/react-performance-track/react-performance-track.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { nextTestSetup } from 'e2e-utils'
22

33
describe('react-performance-track', () => {
4-
const { next } = nextTestSetup({
4+
const { isTurbopack, next } = nextTestSetup({
55
files: __dirname,
66
})
77

@@ -21,7 +21,16 @@ describe('react-performance-track', () => {
2121
await browser.elementByCss('[data-react-server-requests-done]')
2222

2323
const track = await browser.eval('window.reactServerRequests.getSnapshot()')
24-
// FIXME: Should show await fetch
25-
expect(track).toEqual([])
24+
expect(track).toEqual([
25+
{
26+
// TODO(veil): Should always be `fetch (random)`
27+
name: isTurbopack ? 'fetch (random)' : 'patched',
28+
properties: expect.arrayContaining([
29+
['status', '200'],
30+
// Not sure if this is useful to assert on. Feel free to remove is this breaks often
31+
['body', isTurbopack ? 'ReadableStream' : 'TeeReadableStream'],
32+
]),
33+
},
34+
])
2635
})
2736
})

test/e2e/app-dir/dynamic-data/dynamic-data.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ describe('dynamic-data inside cache scope', () => {
336336
| ^",
337337
"stack": [
338338
"${isTurbopack ? '<anonymous>' : 'eval'} app/connection/page.js (4:54)",
339-
"async Page app/connection/page.js (7:3)",
339+
"${isTurbopack || !isExperimentalReact ? 'async ' : ''}Page app/connection/page.js (7:3)",
340340
],
341341
}
342342
`)

test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ describe.each(
140140
"description": "Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
141141
"environmentLabel": "Server",
142142
"label": "Console Error",
143-
"source": "app/page.tsx (20:16) @ Dynamic
144-
> 20 | async function Dynamic() {
145-
| ^",
143+
"source": "app/page.tsx (21:9) @ Dynamic
144+
> 21 | await new Promise((r) => setTimeout(r))
145+
| ^",
146146
"stack": [
147-
"Dynamic app/page.tsx (20:16)",
147+
"Dynamic app/page.tsx (21:9)",
148148
"Page app/page.tsx (15:7)",
149149
"LogSafely <anonymous>",
150150
],
@@ -606,11 +606,11 @@ describe.each(
606606
"description": "Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
607607
"environmentLabel": "Server",
608608
"label": "Console Error",
609-
"source": "app/page.tsx (35:16) @ FetchingComponent
610-
> 35 | async function FetchingComponent({
611-
| ^",
609+
"source": "app/page.tsx (45:56) @ FetchingComponent
610+
> 45 | {cached ? await fetchRandomCached(nonce) : await fetchRandom(nonce)}
611+
| ^",
612612
"stack": [
613-
"FetchingComponent app/page.tsx (35:16)",
613+
"FetchingComponent app/page.tsx (45:56)",
614614
"Page app/page.tsx (22:9)",
615615
"LogSafely <anonymous>",
616616
],
@@ -619,11 +619,11 @@ describe.each(
619619
"description": "Route "/": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
620620
"environmentLabel": "Server",
621621
"label": "Console Error",
622-
"source": "app/page.tsx (35:16) @ FetchingComponent
623-
> 35 | async function FetchingComponent({
624-
| ^",
622+
"source": "app/page.tsx (45:56) @ FetchingComponent
623+
> 45 | {cached ? await fetchRandomCached(nonce) : await fetchRandom(nonce)}
624+
| ^",
625625
"stack": [
626-
"FetchingComponent app/page.tsx (35:16)",
626+
"FetchingComponent app/page.tsx (45:56)",
627627
"Page app/page.tsx (27:7)",
628628
"LogSafely <anonymous>",
629629
],

0 commit comments

Comments
 (0)