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
a40a32d1
Commit
a40a32d1
authored
Dec 11, 2019
by
JJ Kasper
Committed by
Joe Haddad
Dec 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SSG tests failing on windows (#9710)
parent
c4c31732
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
spr-cache.ts
packages/next/next-server/server/spr-cache.ts
+1
-1
index.test.js
test/integration/prerender/test/index.test.js
+11
-0
No files found.
packages/next/next-server/server/spr-cache.ts
View file @
a40a32d1
...
@@ -37,7 +37,7 @@ export const calculateRevalidate = (pathname: string): number | false => {
...
@@ -37,7 +37,7 @@ export const calculateRevalidate = (pathname: string): number | false => {
// in development we don't have a prerender-manifest
// in development we don't have a prerender-manifest
// and default to always revalidating to allow easier debugging
// and default to always revalidating to allow easier debugging
const
curTime
=
new
Date
().
getTime
()
const
curTime
=
new
Date
().
getTime
()
if
(
sprOptions
.
dev
)
return
curTime
if
(
sprOptions
.
dev
)
return
curTime
-
1000
const
{
initialRevalidateSeconds
}
=
prerenderManifest
.
routes
[
pathname
]
||
{
const
{
initialRevalidateSeconds
}
=
prerenderManifest
.
routes
[
pathname
]
||
{
initialRevalidateSeconds
:
1
,
initialRevalidateSeconds
:
1
,
...
...
test/integration/prerender/test/index.test.js
View file @
a40a32d1
...
@@ -105,6 +105,17 @@ const expectedManifestRoutes = () => ({
...
@@ -105,6 +105,17 @@ const expectedManifestRoutes = () => ({
const
navigateTest
=
()
=>
{
const
navigateTest
=
()
=>
{
it
(
'should navigate between pages successfully'
,
async
()
=>
{
it
(
'should navigate between pages successfully'
,
async
()
=>
{
const
toBuild
=
[
'/'
,
'/another'
,
'/something'
,
'/normal'
,
'/blog/post-1'
,
'/blog/post-1/comment-1'
,
]
await
Promise
.
all
(
toBuild
.
map
(
pg
=>
renderViaHTTP
(
appPort
,
pg
)))
const
browser
=
await
webdriver
(
appPort
,
'/'
)
const
browser
=
await
webdriver
(
appPort
,
'/'
)
let
text
=
await
browser
.
elementByCss
(
'p'
).
text
()
let
text
=
await
browser
.
elementByCss
(
'p'
).
text
()
expect
(
text
).
toMatch
(
/hello.*
?
world/
)
expect
(
text
).
toMatch
(
/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