I am trying to do a simple test of an external HTTP resource using mocha. Here is my code:
describe('bing.com', function() {
it('should return 200 for a GET request', function() {
var requestify = require('requestify');
requestify.get('http://bing.com')
.then(function(response) {
// Get the response body (JSON parsed or jQuery object for XMLs)
console.log(response.getBody());
done();
});
});
});
The test just says passed but my console.log
call is never shown. Is mocha completing before the http response is received?