Created
April 14, 2015 22:41
-
-
Save NickHeiner/a5048897ebe077d02ace 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
// BAD APPROACH | |
const heartbeat = require('./heartbeat'), | |
coTape = require('co-tape'), | |
tape = require('tape'); | |
tape('heartbeat', function(t) { | |
t.test('serves heartbeat request', coTape(function*(t) { | |
t.plan(1); | |
// add some knowledge of implementation details of what we're testing | |
let koaContext = { | |
path: '/heartbeat' | |
}, | |
next = function(cb) { cb(); }; | |
yield heartbeat.apply(koaContext, next); | |
t.equal(koaContext.body, 'OK', 'returns the correct response'); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment