@ -106,7 +106,9 @@ function asCallback(opts, cb) {
function asPromise(opts) {
return new PinkiePromise(function (resolve, reject) {
asCallback(opts, function (err, data, response) {
response.body = data;
if (response) {
}
if (err) {
err.response = response;
@ -28,7 +28,7 @@ test('callback mode', function (t) {
});
test('promise mode', function (t) {
t.plan(2);
t.plan(3);
got.get(s.url)
.then(function (res) {
@ -39,6 +39,11 @@ test('promise mode', function (t) {
.catch(function (err) {
t.equal(err.response.body, 'not found');
got.get('.com')
t.ok(err);
test('cleanup', function (t) {