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
f43ae736
Unverified
Commit
f43ae736
authored
Jul 16, 2019
by
Joe Haddad
Committed by
GitHub
Jul 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust test names for `send` (#7996)
* Adjust test names for `serve` * Clarify names more
parent
2a2ebfae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
index.test.js
test/integration/production/test/index.test.js
+15
-4
No files found.
test/integration/production/test/index.test.js
View file @
f43ae736
...
@@ -126,21 +126,32 @@ describe('Production Usage', () => {
...
@@ -126,21 +126,32 @@ describe('Production Usage', () => {
expect
(
res
.
status
).
toBe
(
405
)
expect
(
res
.
status
).
toBe
(
405
)
})
})
it
(
'should return 412
method on static file if If-Unmodified-Since is invali
d'
,
async
()
=>
{
it
(
'should return 412
on static file when If-Unmodified-Since is provided and file is modifie
d'
,
async
()
=>
{
const
buildId
=
readFileSync
(
join
(
__dirname
,
'../.next/BUILD_ID'
),
'utf8'
)
const
buildId
=
readFileSync
(
join
(
__dirname
,
'../.next/BUILD_ID'
),
'utf8'
)
const
res
=
await
fetch
(
const
res
=
await
fetch
(
`http://localhost:
${
appPort
}
/_next/static/
${
buildId
}
/pages/index.js`
,
`http://localhost:
${
appPort
}
/_next/static/
${
buildId
}
/pages/index.js`
,
{
{
method
:
'GET'
,
method
:
'GET'
,
headers
:
{
headers
:
{
'if-unmodified-since'
:
'Fri, 12 Jul 2019 20:00:13 GMT'
}
'if-unmodified-since'
:
'Fri, 12 Jul 2019 20:00:13 GMT'
}
}
}
)
)
expect
(
res
.
status
).
toBe
(
412
)
expect
(
res
.
status
).
toBe
(
412
)
})
})
it
(
'should return 200 on static file if If-Unmodified-Since is invalid date'
,
async
()
=>
{
const
buildId
=
readFileSync
(
join
(
__dirname
,
'../.next/BUILD_ID'
),
'utf8'
)
const
res
=
await
fetch
(
`http://localhost:
${
appPort
}
/_next/static/
${
buildId
}
/pages/index.js`
,
{
method
:
'GET'
,
headers
:
{
'if-unmodified-since'
:
'nextjs'
}
}
)
expect
(
res
.
status
).
toBe
(
200
)
})
it
(
'should set Content-Length header'
,
async
()
=>
{
it
(
'should set Content-Length header'
,
async
()
=>
{
const
url
=
`http://localhost:
${
appPort
}
`
const
url
=
`http://localhost:
${
appPort
}
`
const
res
=
await
fetch
(
url
)
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