This commit is contained in:
David
2019-06-14 12:26:08 -07:00
commit 7f2f4661c7
5 changed files with 2047 additions and 0 deletions

21
test.js Normal file
View File

@@ -0,0 +1,21 @@
const tape = require('tape')
const jsonist = require('jsonist')
const PORT = process.env.PORT = process.env.PORT || require('get-PORT-sync')()
const server = require('./server')
const urlBase = `http://localhost:${PORT}`
tape('should respond hello', (t) => {
jsonist.get(urlBase, (err, body) => {
if (err) t.error(err)
t.equal(body.msg, 'hello')
t.end()
})
})
tape('cleanup', function (t) {
server.close()
t.end()
})