Created
June 3, 2014 15:24
-
-
Save benmkramer/a0aea9d478b8f24425f5 to your computer and use it in GitHub Desktop.
This file contains 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
var request = require('supertest'); | |
var express = require('express'); | |
var app = express(); | |
app.get('/something', function (req, res) { res.send(200); }); | |
it('should respond with 200', function (done) { | |
// PRODUCES DOUBLE CALLBACK | |
request(app) | |
.get('/something') | |
.expect(200, function (res) { | |
return false; | |
}) | |
.end(done); | |
}); | |
it('should also respond with 200', function (done) { | |
// DOES NOT PRODUCE DOUBLE CALLBACK | |
request(app) | |
.get('/something') | |
.expect(function (res) { | |
return false; | |
}) | |
.expect(200, done); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment