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
87d9b2e0
Unverified
Commit
87d9b2e0
authored
Dec 16, 2019
by
JJ Kasper
Committed by
GitHub
Dec 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests ensuring auto-exported amphtml rel is valid (#9762)
parent
2ba056aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
index.test.js
test/integration/amphtml/test/index.test.js
+5
-0
index.test.js
test/integration/serverless-trace/test/index.test.js
+5
-0
index.test.js
test/integration/serverless/test/index.test.js
+5
-0
No files found.
test/integration/amphtml/test/index.test.js
View file @
87d9b2e0
...
...
@@ -151,6 +151,11 @@ describe('AMP Usage', () => {
).
toBe
(
'http://localhost:1234/use-amp-hook.amp'
)
})
it
(
'should render amphtml from provided rel link'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
appPort
,
'/use-amp-hook.amp'
)
await
validateAMP
(
html
)
})
it
(
'should render link rel amphtml with existing query'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
appPort
,
'/use-amp-hook?hello=1'
)
expect
(
html
).
not
.
toMatch
(
/&amp=1/
)
...
...
test/integration/serverless-trace/test/index.test.js
View file @
87d9b2e0
...
...
@@ -76,6 +76,11 @@ describe('Serverless Trace', () => {
expect
(
html
).
toMatch
(
/rel="canonical" href="
\/
some-amp"/
)
})
it
(
'should have correct canonical link (auto-export link)'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
appPort
,
'/some-amp.amp'
)
expect
(
html
).
toMatch
(
/rel="canonical" href="
\/
some-amp"/
)
})
it
(
'should render correctly when importing isomorphic-unfetch'
,
async
()
=>
{
const
url
=
`http://localhost:
${
appPort
}
/fetch`
const
res
=
await
fetch
(
url
)
...
...
test/integration/serverless/test/index.test.js
View file @
87d9b2e0
...
...
@@ -117,6 +117,11 @@ describe('Serverless', () => {
expect
(
html
).
toMatch
(
/rel="canonical" href="
\/
some-amp"/
)
})
it
(
'should have correct canonical link (auto-export link)'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
appPort
,
'/some-amp.amp'
)
expect
(
html
).
toMatch
(
/rel="canonical" href="
\/
some-amp"/
)
})
it
(
'should render correctly when importing isomorphic-unfetch'
,
async
()
=>
{
const
url
=
`http://localhost:
${
appPort
}
/fetch`
const
res
=
await
fetch
(
url
)
...
...
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