Skip to content

Instantly share code, notes, and snippets.

@NickHeiner
Last active August 29, 2015 14:19
Show Gist options
  • Save NickHeiner/c9ad7643698eebef605a to your computer and use it in GitHub Desktop.
Save NickHeiner/c9ad7643698eebef605a to your computer and use it in GitHub Desktop.
// 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