|
|
@ -18,6 +18,13 @@ tape('setup', function (t) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
tape('url argument is required', function (t) { |
|
|
|
t.throws(function () { |
|
|
|
got(); |
|
|
|
}, /Parameter 'url' must be a string or object, not undefined/); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
|
|
|
|
tape('accepts url.parse object as first argument', function (t) { |
|
|
|
got({host: s.host, port: s.port, path: '/test'}, function (err, data) { |
|
|
|
t.error(err); |
|
|
@ -34,6 +41,14 @@ tape('extends parsed string with opts', function (t) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
tape('extends parsed string with opts', function (t) { |
|
|
|
got(s.url + '/?test=doge', {query: {test: 'wow'}}, function (err, data) { |
|
|
|
t.error(err); |
|
|
|
t.equal(data, '/?test=wow'); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
tape('cleanup', function (t) { |
|
|
|
s.close(); |
|
|
|
t.end(); |
|
|
|