You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
542 B

'use strict';
require('../common');
const assert = require('assert');
const http = require('http');
var testServer = new http.Server(function(req, res) {
res.writeHead(200);
res.end('Hello world');
});
testServer.listen(0, function() {
http.get({ port: this.address().port }, function(res) {
assert.equal(res.readable, true, 'res.readable initially true');
res.on('end', function() {
assert.equal(res.readable, false, 'res.readable set to false after end');
testServer.close();
});
res.resume();
});
});