Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
928d9e44
Unverified
Commit
928d9e44
authored
Sep 16, 2025
by
Hendrik Liebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: add debug channel test app
parent
5712c05c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
1 deletion
+78
-1
debug-channel.ts
packages/next/src/server/dev/debug-channel.ts
+1
-1
layout.tsx
test/development/app-dir/react-debug-channel/app/layout.tsx
+8
-0
page.tsx
...evelopment/app-dir/react-debug-channel/app/other/page.tsx
+12
-0
page.tsx
test/development/app-dir/react-debug-channel/app/page.tsx
+13
-0
next.config.js
test/development/app-dir/react-debug-channel/next.config.js
+12
-0
react-debug-channel.test.ts
...t/app-dir/react-debug-channel/react-debug-channel.test.ts
+32
-0
No files found.
packages/next/src/server/dev/debug-channel.ts
View file @
928d9e44
...
...
@@ -27,7 +27,7 @@ export function connectReactDebugChannel(
const
reader
=
debugChannel
.
readable
.
pipeThrough
(
// We're sending the chunks in batches to reduce overhead in the browser.
createBufferedTransformStream
({
maxBufferByteLength
:
128
*
1024
})
createBufferedTransformStream
({
maxBufferByteLength
:
128
*
10
0
24
})
)
.
getReader
()
...
...
test/development/app-dir/react-debug-channel/app/layout.tsx
0 → 100644
View file @
928d9e44
import
{
ReactNode
}
from
'react'
export
default
function
Root
({
children
}:
{
children
:
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/development/app-dir/react-debug-channel/app/other/page.tsx
0 → 100644
View file @
928d9e44
import
Link
from
'next/link'
export
default
function
Page
()
{
return
(
<
div
>
<
p
>
other page
</
p
>
<
p
>
<
Link
href=
"/"
>
Go to home page
</
Link
>
</
p
>
</
div
>
)
}
test/development/app-dir/react-debug-channel/app/page.tsx
0 → 100644
View file @
928d9e44
import
Link
from
'next/link'
export
default
function
Page
()
{
// console.error(new Error('test'))
return
(
<
div
key=
"foo"
>
<
p
>
home page
</
p
>
<
p
>
<
Link
href=
"/other"
>
Go to other page
</
Link
>
</
p
>
</
div
>
)
}
test/development/app-dir/react-debug-channel/next.config.js
0 → 100644
View file @
928d9e44
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{
experimental
:
{
// Force React's experimental build to be used.
taint
:
true
,
// reactDebugChannel: true,
},
}
module
.
exports
=
nextConfig
test/development/app-dir/react-debug-channel/react-debug-channel.test.ts
0 → 100644
View file @
928d9e44
import
{
nextTestSetup
}
from
'e2e-utils'
describe
(
'react-debug-channel'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
// Recommended for tests that check HTML. Cheerio is a HTML parser that has a jQuery like API.
it
(
'should work using cheerio'
,
async
()
=>
{
const
$
=
await
next
.
render$
(
'/'
)
expect
(
$
(
'p'
).
text
()).
toBe
(
'hello world'
)
})
// Recommended for tests that need a full browser
it
(
'should work using browser'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
expect
(
await
browser
.
elementByCss
(
'p'
).
text
()).
toBe
(
'hello world'
)
})
// In case you need the full HTML. Can also use $.html() with cheerio.
it
(
'should work with html'
,
async
()
=>
{
const
html
=
await
next
.
render
(
'/'
)
expect
(
html
).
toContain
(
'hello world'
)
})
// In case you need to test the response object
it
(
'should work with fetch'
,
async
()
=>
{
const
res
=
await
next
.
fetch
(
'/'
)
const
html
=
await
res
.
text
()
expect
(
html
).
toContain
(
'hello world'
)
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment