readable.js 527 B

1234567891011121314151617181920
  1. var test = require('tape');
  2. var hyperquest = require('../');
  3. var http = require('http');
  4. var server = http.createServer(function (req, res) { res.end() });
  5. test('readable', function (t) {
  6. server.listen(function () {
  7. var port = server.address().port;
  8. var req = hyperquest('http://localhost:' + port);
  9. t.notOk(req.flowing);
  10. t.ok(req._read);
  11. req.on('data', function () {});
  12. req.on('end', function () {
  13. server.close();
  14. t.end();
  15. });
  16. });
  17. });