Skip to content

Commit

Permalink
Update test helper functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
snuggs committed Jan 18, 2018
1 parent 2c780b1 commit dfffe49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
25 changes: 0 additions & 25 deletions middleware/policy.es
Original file line number Diff line number Diff line change
@@ -1,25 +0,0 @@
const
{ test, fetch }
= require ('test')

, { Server }
= require ('..')


console.warn ((new Server).serve)

test.only ('calling next middleware')


test ('Content-Security-Policy', async t => {

const
server = (new Server).serve ``
, response = await fetch ('http://localhost:8181/')


t.ok (response.headers)

server.close ``
t.end ()
})
10 changes: 6 additions & 4 deletions test/index.es
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ const
( resource, ... options ) =>
require ('node-fetch') (resource, ... options)

, { test, onFinish : finish }
= require ('tape')

require ('tape')
.onFinish (process.exit)

finish (process.exit)


module.exports = {
fetch
test
, fetch
, read : require ('./read')
, serve : require ('./serve')
, browse : require ('./browse')

// See chunked responses
// http://taylor.fausak.me/2013/02/17/testing-a-node-js-http-server-with-mocha/
, get : require ('http').get
, test : require ('tape').test
}

0 comments on commit dfffe49

Please sign in to comment.