mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
[Tests] ETag
This commit is contained in:
parent
7e57f55a5a
commit
34ad604b98
@ -144,6 +144,15 @@ test('/redirect2 status code', async t => {
|
||||
t.true(output.stderr[0].includes('Error: NOPE!'))
|
||||
})
|
||||
|
||||
test('ETag Header', async t => {
|
||||
const {headers: {etag}} = await rp(url('/stateless'), {resolveWithFullResponse: true})
|
||||
// Validate etag
|
||||
t.regex(etag, /W\/".*"$/)
|
||||
// Verify functionality
|
||||
const error = await t.throws(rp(url('/stateless'), { headers: {'If-None-Match': etag}}))
|
||||
t.is(error.statusCode, 304)
|
||||
})
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
test.after('Closing server and nuxt.js', t => {
|
||||
server.close()
|
||||
|
Loading…
Reference in New Issue
Block a user