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
1e860311
Unverified
Commit
1e860311
authored
Feb 13, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Feb 13, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unisolated tests (#76018)
parent
1769fc29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
create-next-install.js
test/lib/create-next-install.js
+5
-3
base.ts
test/lib/next-modes/base.ts
+21
-12
No files found.
test/lib/create-next-install.js
View file @
1e860311
...
@@ -154,9 +154,11 @@ async function createNextInstall({
...
@@ -154,9 +154,11 @@ async function createNextInstall({
)
)
if
(
beforeInstall
!==
undefined
)
{
if
(
beforeInstall
!==
undefined
)
{
rootSpan
.
traceChild
(
'beforeInstall'
).
traceAsyncFn
(
async
(
span
)
=>
{
await
rootSpan
await
beforeInstall
(
span
,
installDir
)
.
traceChild
(
'beforeInstall'
)
})
.
traceAsyncFn
(
async
(
span
)
=>
{
await
beforeInstall
(
span
,
installDir
)
})
}
}
if
(
installCommand
)
{
if
(
installCommand
)
{
...
...
test/lib/next-modes/base.ts
View file @
1e860311
...
@@ -156,6 +156,16 @@ export class NextInstance {
...
@@ -156,6 +156,16 @@ export class NextInstance {
}
}
}
}
protected
async
beforeInstall
(
parentSpan
:
Span
)
{
await
parentSpan
.
traceChild
(
'writeInitialFiles'
).
traceAsyncFn
(
async
()
=>
{
await
this
.
writeInitialFiles
()
})
await
parentSpan
.
traceChild
(
'writeOverrideFiles'
).
traceAsyncFn
(
async
()
=>
{
await
this
.
writeOverrideFiles
()
})
}
protected
async
createTestDir
({
protected
async
createTestDir
({
skipInstall
=
false
,
skipInstall
=
false
,
parentSpan
,
parentSpan
,
...
@@ -228,6 +238,8 @@ export class NextInstance {
...
@@ -228,6 +238,8 @@ export class NextInstance {
2
2
)
)
)
)
await
this
.
beforeInstall
(
parentSpan
)
}
else
{
}
else
{
if
(
if
(
process
.
env
.
NEXT_TEST_STARTER
&&
process
.
env
.
NEXT_TEST_STARTER
&&
...
@@ -239,6 +251,11 @@ export class NextInstance {
...
@@ -239,6 +251,11 @@ export class NextInstance {
await
fs
.
cp
(
process
.
env
.
NEXT_TEST_STARTER
,
this
.
testDir
,
{
await
fs
.
cp
(
process
.
env
.
NEXT_TEST_STARTER
,
this
.
testDir
,
{
recursive
:
true
,
recursive
:
true
,
})
})
require
(
'console'
).
log
(
'created next.js install, writing test files'
)
await
this
.
beforeInstall
(
parentSpan
)
}
else
{
}
else
{
const
{
tmpRepoDir
}
=
await
createNextInstall
({
const
{
tmpRepoDir
}
=
await
createNextInstall
({
parentSpan
:
rootSpan
,
parentSpan
:
rootSpan
,
...
@@ -250,22 +267,14 @@ export class NextInstance {
...
@@ -250,22 +267,14 @@ export class NextInstance {
keepRepoDir
:
true
,
keepRepoDir
:
true
,
beforeInstall
:
async
(
span
,
installDir
)
=>
{
beforeInstall
:
async
(
span
,
installDir
)
=>
{
this
.
testDir
=
installDir
this
.
testDir
=
installDir
await
span
require
(
'console'
).
log
(
.
traceChild
(
'writeInitialFiles'
)
'created next.js install, writing test files'
.
traceAsyncFn
(
async
()
=>
{
)
await
this
.
writeInitialFiles
()
await
this
.
beforeInstall
(
span
)
})
await
span
.
traceChild
(
'writeOverrideFiles'
)
.
traceAsyncFn
(
async
()
=>
{
await
this
.
writeOverrideFiles
()
})
},
},
})
})
this
.
tmpRepoDir
=
tmpRepoDir
this
.
tmpRepoDir
=
tmpRepoDir
}
}
require
(
'console'
).
log
(
'created next.js install, writing test files'
)
}
}
const
testDirFiles
=
await
fs
.
readdir
(
this
.
testDir
)
const
testDirFiles
=
await
fs
.
readdir
(
this
.
testDir
)
...
...
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