Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created December 19, 2017 01:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save isaacs/940f29811b479b3309567df02e5189eb to your computer and use it in GitHub Desktop.
Save isaacs/940f29811b479b3309567df02e5189eb 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