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
de4f2f03
Unverified
Commit
de4f2f03
authored
Sep 09, 2025
by
Niklas Mischkulnig
Committed by
GitHub
Sep 09, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable more tests for Turbopack, II (#83600)
parent
db2c7bf7
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
119 additions
and
99 deletions
+119
-99
barrel-optimization-mui.test.ts
...basic/barrel-optimization/barrel-optimization-mui.test.ts
+1
-1
barrel-optimization.test.ts
...ent/basic/barrel-optimization/barrel-optimization.test.ts
+2
-1
styled-components-disabled.test.ts
test/development/basic/styled-components-disabled.test.ts
+40
-45
use-cache.test.ts
test/e2e/app-dir/use-cache/use-cache.test.ts
+20
-24
page.js
test/e2e/socket-io/app/page.js
+14
-3
index.test.ts
test/e2e/socket-io/index.test.ts
+18
-3
required-server-files-node-middleware.test.ts
...erver-files/required-server-files-node-middleware.test.ts
+1
-5
required-server-files.test.ts
...-mode/required-server-files/required-server-files.test.ts
+23
-17
No files found.
test/development/basic/barrel-optimization/barrel-optimization-mui.test.ts
View file @
de4f2f03
...
@@ -2,7 +2,7 @@ import { join } from 'path'
...
@@ -2,7 +2,7 @@ import { join } from 'path'
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
assertNoRedbox
}
from
'next-test-utils'
import
{
assertNoRedbox
}
from
'next-test-utils'
//
Skipped in Turbopack, will be added later
.
//
This is implemented in Turbopack, but Turbopack doesn't log the module count
.
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Skipped in Turbopack'
,
'Skipped in Turbopack'
,
()
=>
{
()
=>
{
...
...
test/development/basic/barrel-optimization/barrel-optimization.test.ts
View file @
de4f2f03
import
{
join
}
from
'path'
import
{
join
}
from
'path'
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
nextTestSetup
}
from
'e2e-utils'
// Skipped in Turbopack, will be added later.
// This is implemented in Turbopack, but Turbopack doesn't log the module count.
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Skipped in Turbopack'
,
'Skipped in Turbopack'
,
()
=>
{
()
=>
{
...
...
test/development/basic/styled-components-disabled.test.ts
View file @
de4f2f03
...
@@ -6,9 +6,7 @@ import { retry } from 'next-test-utils'
...
@@ -6,9 +6,7 @@ import { retry } from 'next-test-utils'
// TODO: Somehow the warning doesn't show up with Turbopack, even though the transform is not enabled.
// TODO: Somehow the warning doesn't show up with Turbopack, even though the transform is not enabled.
// TODO: It no longer shows up with Webpack either in tests.
// TODO: It no longer shows up with Webpack either in tests.
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
.
skip
)(
describe
.
skip
(
'styled-components SWC transform'
,
()
=>
{
'styled-components SWC transform'
,
()
=>
{
let
next
:
NextInstance
let
next
:
NextInstance
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
...
@@ -17,9 +15,7 @@ import { retry } from 'next-test-utils'
...
@@ -17,9 +15,7 @@ import { retry } from 'next-test-utils'
'next.config.js'
:
new
FileRef
(
'next.config.js'
:
new
FileRef
(
join
(
__dirname
,
'styled-components-disabled/next.config.js'
)
join
(
__dirname
,
'styled-components-disabled/next.config.js'
)
),
),
pages
:
new
FileRef
(
pages
:
new
FileRef
(
join
(
__dirname
,
'styled-components-disabled/pages'
)),
join
(
__dirname
,
'styled-components-disabled/pages'
)
),
},
},
dependencies
:
{
dependencies
:
{
'styled-components'
:
'6.1.16'
,
'styled-components'
:
'6.1.16'
,
...
@@ -54,5 +50,4 @@ import { retry } from 'next-test-utils'
...
@@ -54,5 +50,4 @@ import { retry } from 'next-test-utils'
}
}
}
}
})
})
}
})
)
test/e2e/app-dir/use-cache/use-cache.test.ts
View file @
de4f2f03
...
@@ -55,15 +55,12 @@ describe('use-cache', () => {
...
@@ -55,15 +55,12 @@ describe('use-cache', () => {
expect
(
await
browser
.
waitForElementByCss
(
'#r'
).
text
()).
toContain
(
'rnd'
)
expect
(
await
browser
.
waitForElementByCss
(
'#r'
).
text
()).
toContain
(
'rnd'
)
})
})
if
(
!
process
.
env
.
TURBOPACK_BUILD
)
{
it
(
'should cache results custom handler'
,
async
()
=>
{
it
(
'should cache results custom handler'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
`/custom-handler?n=1`
)
const
browser
=
await
next
.
browser
(
`/custom-handler?n=1`
)
expect
(
await
browser
.
waitForElementByCss
(
'#x'
).
text
()).
toBe
(
'1'
)
expect
(
await
browser
.
waitForElementByCss
(
'#x'
).
text
()).
toBe
(
'1'
)
const
random1a
=
await
browser
.
waitForElementByCss
(
'#y'
).
text
()
const
random1a
=
await
browser
.
waitForElementByCss
(
'#y'
).
text
()
await
browser
.
loadPage
(
await
browser
.
loadPage
(
new
URL
(
`/custom-handler?n=2`
,
next
.
url
).
toString
())
new
URL
(
`/custom-handler?n=2`
,
next
.
url
).
toString
()
)
expect
(
await
browser
.
waitForElementByCss
(
'#x'
).
text
()).
toBe
(
'2'
)
expect
(
await
browser
.
waitForElementByCss
(
'#x'
).
text
()).
toBe
(
'2'
)
const
random2
=
await
browser
.
waitForElementByCss
(
'#y'
).
text
()
const
random2
=
await
browser
.
waitForElementByCss
(
'#y'
).
text
()
...
@@ -82,7 +79,6 @@ describe('use-cache', () => {
...
@@ -82,7 +79,6 @@ describe('use-cache', () => {
// Client component child should have rendered but not invalidated the cache.
// Client component child should have rendered but not invalidated the cache.
expect
(
await
browser
.
waitForElementByCss
(
'#r'
).
text
()).
toContain
(
'rnd'
)
expect
(
await
browser
.
waitForElementByCss
(
'#r'
).
text
()).
toContain
(
'rnd'
)
})
})
}
it
(
'should cache complex args'
,
async
()
=>
{
it
(
'should cache complex args'
,
async
()
=>
{
// Use two bytes that can't be encoded as UTF-8 to ensure serialization works.
// Use two bytes that can't be encoded as UTF-8 to ensure serialization works.
...
...
test/e2e/socket-io/app/page.js
View file @
de4f2f03
...
@@ -6,6 +6,7 @@ import io from 'socket.io-client'
...
@@ -6,6 +6,7 @@ import io from 'socket.io-client'
let
socket
let
socket
export
default
function
Home
()
{
export
default
function
Home
()
{
const
[
connected
,
setConnected
]
=
useState
(
false
)
const
[
value
,
setValue
]
=
useState
(
''
)
const
[
value
,
setValue
]
=
useState
(
''
)
const
socketInitializer
=
async
()
=>
{
const
socketInitializer
=
async
()
=>
{
...
@@ -26,7 +27,10 @@ export default function Home() {
...
@@ -26,7 +27,10 @@ export default function Home() {
}
}
const
sendMessageHandler
=
async
(
e
)
=>
{
const
sendMessageHandler
=
async
(
e
)
=>
{
if
(
!
socket
)
return
if
(
!
socket
)
{
console
.
error
(
'No socket connection yet for message'
)
return
}
const
value
=
e
.
target
.
value
const
value
=
e
.
target
.
value
setValue
(
value
)
setValue
(
value
)
...
@@ -34,8 +38,15 @@ export default function Home() {
...
@@ -34,8 +38,15 @@ export default function Home() {
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
socketInitializer
()
socketInitializer
().
then
(()
=>
{
setConnected
(
true
)
})
},
[])
},
[])
return
<
input
value
=
{
value
}
onChange
=
{
sendMessageHandler
}
/
>
return
(
<>
<
span
id
=
"status"
>
{
connected
?
'Connected'
:
'Disconnected'
}
<
/span
>
<
input
value
=
{
value
}
onChange
=
{
sendMessageHandler
}
/
>
<
/
>
)
}
}
test/e2e/socket-io/index.test.ts
View file @
de4f2f03
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
check
}
from
'next-test-utils'
import
{
retry
}
from
'next-test-utils'
describe
(
'socket-io'
,
()
=>
{
describe
(
'socket-io'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
const
{
next
}
=
nextTestSetup
({
...
@@ -27,17 +27,32 @@ describe('socket-io', () => {
...
@@ -27,17 +27,32 @@ describe('socket-io', () => {
},
},
})
})
await
Promise
.
all
([
retry
(
async
()
=>
expect
(
await
browser1
.
elementByCss
(
'#status'
).
text
()).
toBe
(
'Connected'
)
),
retry
(
async
()
=>
expect
(
await
browser2
.
elementByCss
(
'#status'
).
text
()).
toBe
(
'Connected'
)
),
])
const
input1
=
await
browser1
.
elementByCss
(
'input'
)
const
input1
=
await
browser1
.
elementByCss
(
'input'
)
const
input2
=
await
browser2
.
elementByCss
(
'input'
)
const
input2
=
await
browser2
.
elementByCss
(
'input'
)
await
input1
.
fill
(
'hello world'
)
await
input1
.
fill
(
'hello world'
)
await
check
(()
=>
input2
.
inputValue
(),
/hello world/
)
await
retry
(
async
()
=>
expect
(
await
input2
.
inputValue
()).
toContain
(
'hello world'
),
10000
)
expect
(
requestsCount
).
toBeGreaterThan
(
0
)
expect
(
requestsCount
).
toBeGreaterThan
(
0
)
const
currentRequestsCount
=
requestsCount
const
currentRequestsCount
=
requestsCount
await
input1
.
fill
(
'123456'
)
await
input1
.
fill
(
'123456'
)
await
check
(()
=>
input2
.
inputValue
(),
/123456/
)
await
retry
(
async
()
=>
expect
(
await
input2
.
inputValue
()).
toContain
(
'123456'
),
10000
)
// There should be no new requests (polling) and using the existing WS connection
// There should be no new requests (polling) and using the existing WS connection
expect
(
requestsCount
).
toBe
(
currentRequestsCount
)
expect
(
requestsCount
).
toBe
(
currentRequestsCount
)
...
...
test/production/standalone-mode/required-server-files/required-server-files-node-middleware.test.ts
View file @
de4f2f03
process
.
env
.
TEST_NODE_MIDDLEWARE
=
'1'
process
.
env
.
TEST_NODE_MIDDLEWARE
=
'1'
if
(
process
.
env
.
IS_TURBOPACK_TEST
)
{
require
(
'./required-server-files.test'
)
it
(
'should skip for now'
,
()
=>
{})
}
else
{
require
(
'./required-server-files.test'
)
}
test/production/standalone-mode/required-server-files/required-server-files.test.ts
View file @
de4f2f03
...
@@ -377,29 +377,35 @@ describe('required server files', () => {
...
@@ -377,29 +377,35 @@ describe('required server files', () => {
).
toContain
(
'"cacheMaxMemorySize":0'
)
).
toContain
(
'"cacheMaxMemorySize":0'
)
})
})
// TODO(mischnic) do these files even exist in turbopack?
it
(
'should output middleware correctly'
,
async
()
=>
{
;(
process
.
env
.
IS_TURBOPACK_TEST
?
it
.
skip
:
it
)(
if
(
process
.
env
.
TEST_NODE_MIDDLEWARE
)
{
'should output middleware correctly'
,
async
()
=>
{
if
(
!
process
.
env
.
TEST_NODE_MIDDLEWARE
)
{
// eslint-disable-next-line jest/no-standalone-expect
expect
(
expect
(
await
fs
.
pathExists
(
await
fs
.
pathExists
(
join
(
join
(
next
.
testDir
,
'standalone/.next/server/middleware.js'
)
next
.
testDir
,
'standalone/.next/server/edge-runtime-webpack.js'
)
)
)
).
toBe
(
true
)
).
toBe
(
true
)
}
}
else
{
// eslint-disable-next-line jest/no-standalone-expect
let
manifest
=
await
fs
.
readJSON
(
expect
(
join
(
next
.
testDir
,
'standalone/.next/server/middleware-manifest.json'
)
await
fs
.
pathExists
(
join
(
next
.
testDir
,
'standalone/.next/server/middleware.js'
)
)
)
let
middleware
=
manifest
.
middleware
[
'/'
]
let
files
=
[
...
middleware
.
files
,
...
middleware
.
wasm
.
map
((
f
)
=>
f
.
filePath
),
...
middleware
.
assets
.
map
((
f
)
=>
f
.
filePath
),
]
console
.
log
(
files
)
for
(
const
file
of
files
)
{
try
{
expect
(
await
fs
.
pathExists
(
join
(
next
.
testDir
,
'standalone/.next'
,
file
))
).
toBe
(
true
)
).
toBe
(
true
)
}
catch
(
err
)
{
throw
new
Error
(
'Missing file '
+
file
)
}
}
)
}
}
})
it
(
'should output required-server-files manifest correctly'
,
async
()
=>
{
it
(
'should output required-server-files manifest correctly'
,
async
()
=>
{
expect
(
requiredFilesManifest
.
version
).
toBe
(
1
)
expect
(
requiredFilesManifest
.
version
).
toBe
(
1
)
...
...
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