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
f7c27432
Unverified
Commit
f7c27432
authored
May 12, 2025
by
Jiwon Choi
Committed by
GitHub
May 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: remove unnecessary conditionals in error recovery tests (#73625)
This PR removed unnecessary basePath conditional checks.
parent
d48881e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
66 deletions
+3
-66
run-error-recovery-hmr-test.util.ts
...development/basic/hmr/run-error-recovery-hmr-test.util.ts
+3
-66
No files found.
test/development/basic/hmr/run-error-recovery-hmr-test.util.ts
View file @
f7c27432
...
@@ -164,7 +164,7 @@ export function runErrorRecoveryHmrTest(nextConfig: {
...
@@ -164,7 +164,7 @@ export function runErrorRecoveryHmrTest(nextConfig: {
await
assertHasRedbox
(
browser
)
await
assertHasRedbox
(
browser
)
const
source
=
next
.
normalizeTestDirContent
(
await
getRedboxSource
(
browser
))
const
source
=
next
.
normalizeTestDirContent
(
await
getRedboxSource
(
browser
))
if
(
basePath
===
''
&&
process
.
env
.
IS_TURBOPACK_TEST
)
{
if
(
process
.
env
.
IS_TURBOPACK_TEST
)
{
expect
(
source
).
toMatchInlineSnapshot
(
`
expect
(
source
).
toMatchInlineSnapshot
(
`
"./pages/hmr/about2.js (7:1)
"./pages/hmr/about2.js (7:1)
Parsing ecmascript source code failed
Parsing ecmascript source code failed
...
@@ -176,7 +176,7 @@ export function runErrorRecoveryHmrTest(nextConfig: {
...
@@ -176,7 +176,7 @@ export function runErrorRecoveryHmrTest(nextConfig: {
Unexpected token. Did you mean \`{'}'}\` or \`}\`?"
Unexpected token. Did you mean \`{'}'}\` or \`}\`?"
`
)
`
)
}
else
if
(
basePath
===
''
&&
process
.
env
.
NEXT_RSPACK
)
{
}
else
if
(
process
.
env
.
NEXT_RSPACK
)
{
expect
(
trimEndMultiline
(
source
)).
toMatchInlineSnapshot
(
`
expect
(
trimEndMultiline
(
source
)).
toMatchInlineSnapshot
(
`
"./pages/hmr/about2.js
"./pages/hmr/about2.js
× Module build failed:
× Module build failed:
...
@@ -203,70 +203,7 @@ export function runErrorRecoveryHmrTest(nextConfig: {
...
@@ -203,70 +203,7 @@ export function runErrorRecoveryHmrTest(nextConfig: {
Import trace for requested module:
Import trace for requested module:
./pages/hmr/about2.js"
./pages/hmr/about2.js"
`
)
`
)
}
else
if
(
basePath
===
''
)
{
}
else
{
expect
(
source
).
toMatchInlineSnapshot
(
`
"./pages/hmr/about2.js
Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
,-[7:1]
4 | <p>This is the about page.</p>
5 | div
6 | )
7 | }
: ^
\`----
x Unexpected eof
,-[7:3]
5 | div
6 | )
7 | }
\`----
Caused by:
Syntax Error
Import trace for requested module:
./pages/hmr/about2.js"
`
)
}
else
if
(
basePath
===
'/docs'
&&
process
.
env
.
IS_TURBOPACK_TEST
)
{
expect
(
source
).
toMatchInlineSnapshot
(
`
"./pages/hmr/about2.js (7:1)
Parsing ecmascript source code failed
5 | div
6 | )
> 7 | }
| ^
8 |
Unexpected token. Did you mean \`{'}'}\` or \`}\`?"
`
)
}
else
if
(
basePath
===
'/docs'
&&
process
.
env
.
NEXT_RSPACK
)
{
expect
(
trimEndMultiline
(
source
)).
toMatchInlineSnapshot
(
`
"./pages/hmr/about2.js
× Module build failed:
├─▶ ×
│ │ x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
│ │ ,-[TEST_DIR/pages/hmr/about2.js:7:1]
│ │ 4 | <p>This is the about page.</p>
│ │ 5 | div
│ │ 6 | )
│ │ 7 | }
│ │ : ^
│ │ \`----
│ │
│ │ x Unexpected eof
│ │ ,-[TEST_DIR/pages/hmr/about2.js:7:3]
│ │ 5 | div
│ │ 6 | )
│ │ 7 | }
│ │ \`----
│ │
│
╰─▶ Syntax Error
Import trace for requested module:
./pages/hmr/about2.js"
`
)
}
else
if
(
basePath
===
'/docs'
)
{
expect
(
source
).
toMatchInlineSnapshot
(
`
expect
(
source
).
toMatchInlineSnapshot
(
`
"./pages/hmr/about2.js
"./pages/hmr/about2.js
Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
...
...
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