Skip to content

Commit

Permalink
Add test for GET /snuggsi.es
Browse files Browse the repository at this point in the history
  • Loading branch information
snuggs committed Jan 29, 2018
1 parent 2f9e801 commit 86e9912
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions middleware/snuggsi.test
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,29 @@ test ('GET /snuggsi Accept-Encoding: br', async t => {
})


test.only ('GET /snuggsi.es', async t => {

const
server = serve ``
, body = read `dist/snuggsi.min.es.br`

, options
= { compress: false , headers: { 'Accept-Encoding' : 'br' } }

, response
= await fetch ('http://localhost:8181/snuggsi.js', options)

, type
= response.headers.get ('content-type')


t.ok (type.match (/charset=utf-8/))
t.ok (type.match (/application\/ecmascript/))
t.equal ( await read (response.body), body )
t.equal ( response.headers.get ('content-encoding'), 'br' )

server.close ``
t.end ()
})


0 comments on commit 86e9912

Please sign in to comment.