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
bc845f22
Unverified
Commit
bc845f22
authored
Apr 19, 2020
by
Joe Haddad
Committed by
GitHub
Apr 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stabilize HMR tests on CI (#12029)
parent
450d4bd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
hot-dev-client.js
packages/next/client/dev/error-overlay/hot-dev-client.js
+6
-0
helpers.js
test/acceptance/helpers.js
+13
-3
No files found.
packages/next/client/dev/error-overlay/hot-dev-client.js
View file @
bc845f22
...
@@ -213,6 +213,12 @@ function handleErrors(errors) {
...
@@ -213,6 +213,12 @@ function handleErrors(errors) {
// Do not attempt to reload now.
// Do not attempt to reload now.
// We will reload on next success instead.
// We will reload on next success instead.
if
(
process
.
env
.
__NEXT_TEST_MODE
)
{
if
(
self
.
__NEXT_HMR_CB
)
{
self
.
__NEXT_HMR_CB
(
formatted
.
errors
[
0
])
self
.
__NEXT_HMR_CB
=
null
}
}
}
}
function
tryDismissErrorOverlay
()
{
function
tryDismissErrorOverlay
()
{
...
...
test/acceptance/helpers.js
View file @
bc845f22
...
@@ -69,7 +69,7 @@ export async function sandbox(id = nanoid()) {
...
@@ -69,7 +69,7 @@ export async function sandbox(id = nanoid()) {
console
.
log
(
'Application re-loaded.'
)
console
.
log
(
'Application re-loaded.'
)
// Slow down tests a bit:
// Slow down tests a bit:
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
2
50
))
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
7
50
))
return
false
return
false
}
}
if
(
status
===
'success'
)
{
if
(
status
===
'success'
)
{
...
@@ -83,8 +83,8 @@ export async function sandbox(id = nanoid()) {
...
@@ -83,8 +83,8 @@ export async function sandbox(id = nanoid()) {
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
30
))
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
30
))
}
}
// Slow down tests a bit:
// Slow down tests a bit
(we don't know how long re-rendering takes)
:
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
2
50
))
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
7
50
))
return
true
return
true
},
},
async
remove
(
fileName
)
{
async
remove
(
fileName
)
{
...
@@ -103,6 +103,16 @@ export async function sandbox(id = nanoid()) {
...
@@ -103,6 +103,16 @@ export async function sandbox(id = nanoid()) {
)
)
}
}
},
},
async
getOverlayContent
()
{
await
browser
.
waitForElementByCss
(
'iframe'
,
10000
)
const
hasIframe
=
await
browser
.
hasElementByCssSelector
(
'iframe'
)
if
(
!
hasIframe
)
{
throw
new
Error
(
'Unable to find overlay'
)
}
return
browser
.
eval
(
`document.querySelector('iframe').contentWindow.document.body.innerHTML`
)
},
},
},
function
cleanup
()
{
function
cleanup
()
{
async
function
_cleanup
()
{
async
function
_cleanup
()
{
...
...
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