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
fd1636ae
Unverified
Commit
fd1636ae
authored
Dec 20, 2019
by
JJ Kasper
Committed by
GitHub
Dec 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update prerender test for Windows (#9800)
parent
dcab416d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
something.js
test/integration/prerender/pages/something.js
+3
-1
index.test.js
test/integration/prerender/test/index.test.js
+11
-0
next-test-utils.js
test/lib/next-test-utils.js
+1
-1
No files found.
test/integration/prerender/pages/something.js
View file @
fd1636ae
...
...
@@ -9,16 +9,18 @@ export async function unstable_getStaticProps({ params }) {
world
:
'world'
,
params
:
params
||
{},
time
:
new
Date
().
getTime
(),
random
:
Math
.
random
(),
},
revalidate
:
false
,
}
}
export
default
({
world
,
time
,
params
})
=>
{
export
default
({
world
,
time
,
params
,
random
})
=>
{
return
(
<>
<
p
>
hello
:
{
world
}
<
/p
>
<
span
>
time
:
{
time
}
<
/span
>
<
div
>
{
random
}
<
/div
>
<
div
id
=
"params"
>
{
JSON
.
stringify
(
params
)}
<
/div
>
<
div
id
=
"query"
>
{
JSON
.
stringify
(
useRouter
().
query
)}
<
/div
>
<
Link
href
=
"/"
>
...
...
test/integration/prerender/test/index.test.js
View file @
fd1636ae
...
...
@@ -322,6 +322,17 @@ const runTests = (dev = false) => {
)
const
escapedBuildId
=
buildId
.
replace
(
/
[
|
\\
{}()[
\]
^$+*?.-
]
/g
,
'
\\
$&'
)
Object
.
keys
(
manifest
.
dynamicRoutes
).
forEach
(
key
=>
{
const
item
=
manifest
.
dynamicRoutes
[
key
]
if
(
item
.
dataRouteRegex
)
{
item
.
dataRouteRegex
=
normalizeRegEx
(
item
.
dataRouteRegex
)
}
if
(
item
.
routeRegex
)
{
item
.
routeRegex
=
normalizeRegEx
(
item
.
routeRegex
)
}
})
expect
(
manifest
.
version
).
toBe
(
1
)
expect
(
manifest
.
routes
).
toEqual
(
expectedManifestRoutes
())
expect
(
manifest
.
dynamicRoutes
).
toEqual
({
...
...
test/lib/next-test-utils.js
View file @
fd1636ae
...
...
@@ -401,5 +401,5 @@ export function getBrowserBodyText(browser) {
}
export
function
normalizeRegEx
(
src
)
{
return
new
RegExp
(
src
).
source
return
new
RegExp
(
src
).
source
.
replace
(
/
\^\/
/g
,
'^
\\
/'
)
}
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