Browse Source

Merge pull request #42 from floatdrop/coverage

Add test on stream body in Stream mode
http2
Sindre Sorhus 10 years ago
parent
commit
1556085c13
  1. 8
      package.json
  2. 8
      test/test-post.js

8
package.json

@ -20,7 +20,8 @@
"node": ">=0.10.0"
},
"scripts": {
"test": "taper test/test-*.js"
"test": "tape test/test-*.js | tap-dot",
"coverage": "istanbul cover tape --report html -- test/test-*.js"
},
"files": [
"index.js"
@ -50,8 +51,9 @@
},
"devDependencies": {
"from2-array": "0.0.3",
"istanbul": "^0.3.13",
"pem": "^1.4.4",
"tape": "^3.0.3",
"taper": "^0.3.0"
"tap-dot": "^1.0.0",
"tape": "^3.5.0"
}
}

8
test/test-post.js

@ -42,6 +42,14 @@ tape('works with empty post response', function (t) {
});
});
tape('return readable stream', function (t) {
got.post(s.url, {body: from(['wow'])})
.on('data', function (data) {
t.equal(data.toString(), 'wow');
t.end();
});
});
tape('return writeable stream', function (t) {
got.post(s.url)
.on('data', function (data) {

Loading…
Cancel
Save