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
d97d045d
Unverified
Commit
d97d045d
authored
Jul 31, 2020
by
Jan Potoms
Committed by
GitHub
Jul 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stabilize another test (#15697)
Saw this one fail on azure
parent
766fef22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
index.test.js
...tegration/empty-object-getInitialProps/test/index.test.js
+19
-14
No files found.
test/integration/empty-object-getInitialProps/test/index.test.js
View file @
d97d045d
...
@@ -8,6 +8,7 @@ import {
...
@@ -8,6 +8,7 @@ import {
launchApp
,
launchApp
,
killApp
,
killApp
,
waitFor
,
waitFor
,
check
,
}
from
'next-test-utils'
}
from
'next-test-utils'
jest
.
setTimeout
(
1000
*
60
*
2
)
jest
.
setTimeout
(
1000
*
60
*
2
)
...
@@ -49,20 +50,24 @@ describe('Empty Project', () => {
...
@@ -49,20 +50,24 @@ describe('Empty Project', () => {
it
(
'should show empty object warning during client transition'
,
async
()
=>
{
it
(
'should show empty object warning during client transition'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/static'
)
const
browser
=
await
webdriver
(
appPort
,
'/static'
)
await
browser
.
eval
(
`(function() {
try
{
window.gotWarn = false
await
browser
.
eval
(
`(function() {
const origWarn = console.warn
window.gotWarn = false
window.console.warn = function () {
const origWarn = console.warn
if (arguments[0].match(/returned an empty object from \`getInitialProps\`/)) {
window.console.warn = function () {
window.gotWarn = true
if (arguments[0].match(/returned an empty object from \`getInitialProps\`/)) {
window.gotWarn = true
}
origWarn.apply(this, arguments)
}
}
origWarn.apply(this, arguments)
window.next.router.replace('/another')
}
})()`
)
window.next.router.replace('/another')
await
check
(
async
()
=>
{
})()`
)
const
gotWarn
=
await
browser
.
eval
(
`window.gotWarn`
)
await
waitFor
(
1000
)
return
gotWarn
?
'pass'
:
'fail'
const
gotWarn
=
await
browser
.
eval
(
`window.gotWarn`
)
},
'pass'
)
expect
(
gotWarn
).
toBe
(
true
)
}
finally
{
await
browser
.
close
()
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