Skip to content

Instantly share code, notes, and snippets.

@idettman
Forked from isaacs/h.js
Created February 23, 2018 19:33
Show Gist options
  • Save idettman/1677f73deb047f72e5706361b8ab1e1e to your computer and use it in GitHub Desktop.
Save idettman/1677f73deb047f72e5706361b8ab1e1e to your computer and use it in GitHub Desktop.
'use strict'
const test = require('tap').test
const server = {
inject: options => new Promise(r => r({ statusCode: 200, payload: 'Hello world' }))
}
test('Home entry', async t => {
const options = {
method: 'GET',
url: '/'
}
const response = await server.inject(options)
t.equal(response.statusCode, 200, 'status code = 200')
t.equal(response.payload, 'Hello world', 'Text must be Hello world')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment