init
This commit is contained in:
21
test.js
Normal file
21
test.js
Normal 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()
|
||||
})
|
||||
Reference in New Issue
Block a user