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

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-01-30 12:08:40 -05:00

29 lines
601 B
JavaScript

// Called by test/pummel/test-regress-GH-892.js
const https = require('https');
const fs = require('fs');
const 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);
});