node/test/fixtures/GH-892-request.js
Gibson Fahnestock 6f85c81f0d
test: s/assert.equal/assert.strictEqual/
Use assert.strictEqual instead of assert.equal in tests, manually
convert types where necessary.

Backport-PR-URL: https://github.com/nodejs/node/pull/11795
PR-URL: https://github.com/nodejs/node/pull/10698
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-04-18 20:01:52 -04:00

29 lines
595 B
JavaScript

// Called by test/pummel/test-regress-GH-892.js
var https = require('https');
var fs = require('fs');
var assert = require('assert');
var PORT = parseInt(process.argv[2]);
var bytesExpected = parseInt(process.argv[3]);
var gotResponse = false;
var options = {
method: 'POST',
port: PORT,
rejectUnauthorized: false
};
var req = https.request(options, function(res) {
assert.strictEqual(200, res.statusCode);
gotResponse = true;
console.error('DONE');
res.resume();
});
req.end(Buffer.allocUnsafe(bytesExpected));
process.on('exit', function() {
assert.ok(gotResponse);
});