Unverified Commit f43ae736 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Adjust test names for `send` (#7996)

* Adjust test names for `serve`

* Clarify names more
parent 2a2ebfae
......@@ -126,21 +126,32 @@ describe('Production Usage', () => {
expect(res.status).toBe(405)
})
it('should return 412 method on static file if If-Unmodified-Since is invalid', async () => {
it('should return 412 on static file when If-Unmodified-Since is provided and file is modified', 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': 'Fri, 12 Jul 2019 20:00:13 GMT'
}
headers: { 'if-unmodified-since': 'Fri, 12 Jul 2019 20:00:13 GMT' }
}
)
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 () => {
const url = `http://localhost:${appPort}`
const res = await fetch(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment