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
e0858ec6
Unverified
Commit
e0858ec6
authored
Jul 20, 2024
by
Hendrik Liebau
Committed by
GitHub
Jul 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flakiness of `should not cause error when removing loading.js` test (#67978)
parent
f4a8008c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
index.test.ts
test/e2e/app-dir/app-compilation/index.test.ts
+19
-12
No files found.
test/e2e/app-dir/app-compilation/index.test.ts
View file @
e0858ec6
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
assertNoRedbox
,
check
,
waitFor
}
from
'next-test-utils'
import
{
assertNoRedbox
,
retry
}
from
'next-test-utils'
describe
(
'app dir'
,
()
=>
{
describe
(
'app dir'
,
()
=>
{
const
{
next
,
isNextDev
,
isNextStart
,
skipped
}
=
nextTestSetup
({
const
{
next
,
isNextDev
,
isNextStart
,
skipped
}
=
nextTestSetup
({
...
@@ -23,30 +23,37 @@ describe('app dir', () => {
...
@@ -23,30 +23,37 @@ describe('app dir', () => {
describe
(
'HMR'
,
()
=>
{
describe
(
'HMR'
,
()
=>
{
it
(
'should not cause error when removing loading.js'
,
async
()
=>
{
it
(
'should not cause error when removing loading.js'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/page-with-loading'
)
const
browser
=
await
next
.
browser
(
'/page-with-loading'
)
await
check
(
()
=>
browser
.
elementByCss
(
'h1'
).
text
(),
await
retry
(
async
()
=>
{
'hello from slow page'
const
headline
=
await
browser
.
elementByCss
(
'h1'
).
text
()
)
expect
(
headline
).
toBe
(
'hello from slow page'
)
})
const
cliOutputLength
=
next
.
cliOutput
.
length
await
next
.
renameFile
(
await
next
.
renameFile
(
'app/page-with-loading/loading.js'
,
'app/page-with-loading/loading.js'
,
'app/page-with-loading/_loading.js'
'app/page-with-loading/_loading.js'
)
)
await
waitFor
(
1000
)
await
retry
(
async
()
=>
{
expect
(
next
.
cliOutput
.
slice
(
cliOutputLength
)).
toInclude
(
'✓ Compiled'
)
})
// It should not have an error
// It should not have an error
await
assertNoRedbox
(
browser
)
await
assertNoRedbox
(
browser
)
// HMR should still work
// HMR should still work
const
code
=
await
next
.
readFile
(
'app/page-with-loading/page.js'
)
await
next
.
patchFile
(
await
next
.
patchFile
(
'app/page-with-loading/page.js'
,
'app/page-with-loading/page.js'
,
code
.
replace
(
'hello from slow page'
,
'hello from new page'
)
(
content
)
=>
)
content
.
replace
(
'hello from slow page'
,
'hello from new page'
),
await
check
(
async
()
=>
()
=>
browser
.
elementByCss
(
'h1'
).
text
(),
retry
(
async
()
=>
{
'hello from new page'
const
headline
=
await
browser
.
elementByCss
(
'h1'
).
text
()
expect
(
headline
).
toBe
(
'hello from new page'
)
await
browser
.
close
()
})
)
)
})
})
})
})
...
...
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