Browse Source

Add test on empty POST response

To ensure https://github.com/substack/hyperquest/issues/33
http2
Vsevolod Strukchinsky 10 years ago
parent
commit
79d9870646
  1. 11
      test/test-post.js

11
test/test-post.js

@ -11,6 +11,10 @@ s.on('/', function (req, res) {
req.pipe(res);
});
s.on('/empty', function (req, res) {
res.end();
});
tape('setup', function (t) {
s.listen(s.port, function () {
t.end();
@ -33,6 +37,13 @@ tape('send data from options with post request', function (t) {
});
});
tape('works with empty post response', function (t) {
got(s.url + '/empty', {body: 'wow'}, function (err, data) {
t.equal(data, '');
t.end();
});
});
tape('return writeable stream', function (t) {
got.post(s.url)
.on('data', function (data) {

Loading…
Cancel
Save