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
56dc8548
Commit
56dc8548
authored
May 10, 2017
by
Arunoda Susiripala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ssr tests for next-export
parent
7b193f1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
index.test.js
test/integration/static/test/index.test.js
+3
-7
ssr.js
test/integration/static/test/ssr.js
+21
-0
No files found.
test/integration/static/test/index.test.js
View file @
56dc8548
...
@@ -4,12 +4,13 @@ import { join } from 'path'
...
@@ -4,12 +4,13 @@ import { join } from 'path'
import
{
import
{
nextBuild
,
nextBuild
,
nextExport
,
nextExport
,
renderViaHTTP
,
startStaticServer
,
startStaticServer
,
stopApp
stopApp
}
from
'next-test-utils'
}
from
'next-test-utils'
import
webdriver
from
'next-webdriver'
import
webdriver
from
'next-webdriver'
import
ssr
from
'./ssr'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
40000
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
40000
const
appDir
=
join
(
__dirname
,
'../'
)
const
appDir
=
join
(
__dirname
,
'../'
)
const
context
=
{}
const
context
=
{}
...
@@ -25,12 +26,7 @@ describe('Static Export', () => {
...
@@ -25,12 +26,7 @@ describe('Static Export', () => {
})
})
afterAll
(()
=>
stopApp
(
context
.
server
))
afterAll
(()
=>
stopApp
(
context
.
server
))
describe
(
'Render via SSR'
,
()
=>
{
ssr
(
context
)
it
(
'should render the home page'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
context
.
port
,
'/'
)
expect
(
html
).
toMatch
(
/This is the home page/
)
})
})
describe
(
'Render via browser'
,
()
=>
{
describe
(
'Render via browser'
,
()
=>
{
it
(
'should render the home page'
,
async
()
=>
{
it
(
'should render the home page'
,
async
()
=>
{
...
...
test/integration/static/test/ssr.js
0 → 100644
View file @
56dc8548
/* global describe, it, expect */
import
{
renderViaHTTP
}
from
'next-test-utils'
export
default
function
(
context
)
{
describe
(
'Render via SSR'
,
()
=>
{
it
(
'should render the home page'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
context
.
port
,
'/'
)
expect
(
html
).
toMatch
(
/This is the home page/
)
})
it
(
'should render a page with getInitialProps'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
context
.
port
,
'/dynamic'
)
expect
(
html
).
toMatch
(
/cool dynamic text/
)
})
it
(
'should render a dynamically rendered custom url page'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
context
.
port
,
'/dynamic/one'
)
expect
(
html
).
toMatch
(
/next export is nice/
)
})
})
}
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