Last active
August 29, 2015 14:19
-
-
Save NickHeiner/c9ad7643698eebef605a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Good approach | |
'use strict'; | |
const coRequest = require('co-request'), | |
tape = require('tape'), | |
coTape = require('co-tape'), | |
makeServer = require('../..'); | |
tape('heartbeat', function(t) { | |
const app = makeServer(); | |
t.test('serves heartbeat request', coTape(function*(t) { | |
t.plan(2); | |
let response = yield coRequest('https://localhost:3000/heartbeat'); | |
t.equal(response.body, 'OK', 'returns the correct response'); | |
t.equal(response.statusCode, 200, 'should have status code 200'); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment