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
06c5ea4f
Unverified
Commit
06c5ea4f
authored
May 02, 2024
by
Sebastian Silbermann
Committed by
GitHub
May 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract slow tests to avoid wasteful start/stop (#65265)
parent
6475431a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
31 deletions
+41
-31
parallel-routes-and-interception.test.ts
...and-interception/parallel-routes-and-interception.test.ts
+41
-31
No files found.
test/e2e/app-dir/parallel-routes-and-interception/parallel-routes-and-interception.test.ts
View file @
06c5ea4f
...
...
@@ -183,37 +183,6 @@ describe('parallel-routes-and-interception', () => {
expect
(
pageText
).
toContain
(
'parallel/(new)/@baz/nested/page'
)
})
it
(
'should gracefully handle when two page segments match the `children` parallel slot'
,
async
()
=>
{
await
next
.
stop
()
await
next
.
patchFile
(
'app/parallel/nested-2/page.js'
,
outdent
`
export default function Page() {
return 'hello world'
}
`
)
await
next
.
start
()
const
html
=
await
next
.
render
(
'/parallel/nested-2'
)
// before adding this file, the page would have matched `/app/parallel/(new)/@baz/nested-2/page`
// but we've added a more specific page, so it should match that instead
if
(
process
.
env
.
TURBOPACK
)
{
// TODO: this matches differently in Turbopack because the Webpack loader does some sorting on the paths
// Investigate the discrepancy in a follow-up. For now, since no errors are being thrown (and since this test was previously ignored in Turbopack),
// we'll just verify that the page is rendered and some content was matched.
expect
(
html
).
toContain
(
'parallel/(new)/@baz/nested/page'
)
}
else
{
expect
(
html
).
toContain
(
'hello world'
)
}
await
next
.
stop
()
await
next
.
deleteFile
(
'app/parallel/nested-2/page.js'
)
await
next
.
start
()
})
it
(
'should throw a 404 when no matching parallel route is found'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/parallel-tab-bar'
)
// we make sure the page is available through navigating
...
...
@@ -909,3 +878,44 @@ describe('parallel-routes-and-interception', () => {
}
})
})
describe
(
'parallel-routes-and-interception with patching'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
skipStart
:
true
,
})
afterEach
(
async
()
=>
{
try
{
await
next
.
stop
()
}
finally
{
await
next
.
deleteFile
(
'app/parallel/nested-2/page.js'
)
}
})
it
(
'should gracefully handle when two page segments match the `children` parallel slot'
,
async
()
=>
{
await
next
.
patchFile
(
'app/parallel/nested-2/page.js'
,
outdent
`
export default function Page() {
return 'hello world'
}
`
)
await
next
.
start
()
const
html
=
await
next
.
render
(
'/parallel/nested-2'
)
// before adding this file, the page would have matched `/app/parallel/(new)/@baz/nested-2/page`
// but we've added a more specific page, so it should match that instead
if
(
process
.
env
.
TURBOPACK
)
{
// TODO: this matches differently in Turbopack because the Webpack loader does some sorting on the paths
// Investigate the discrepancy in a follow-up. For now, since no errors are being thrown (and since this test was previously ignored in Turbopack),
// we'll just verify that the page is rendered and some content was matched.
expect
(
html
).
toContain
(
'parallel/(new)/@baz/nested/page'
)
}
else
{
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