node/test/parallel/test-http-response-readable.js
isurusiri f565bbb193 test: remove message from strictEqual assertions
If values are not equals in strictEqual assertions, an AssertionError is
thrown with a message property set equals to the value of the message
parameter. If we pass a message, this message will be printed instead of
the default message, which contains the value that is causing the error.
Hence removed the value passed as the message in strictEqual assertions
of test/parallel/test-http-response-readable.js

PR-URL: https://github.com/nodejs/node/pull/20067
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-18 09:52:02 -07:00

42 lines
1.6 KiB
JavaScript

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../common');
const assert = require('assert');
const http = require('http');
const 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.strictEqual(res.readable, true);
res.on('end', function() {
assert.strictEqual(res.readable, false);
testServer.close();
});
res.resume();
});
});