summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-client-timeout.js
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2015-05-13 21:25:57 -0500
committerRoman Reiss <me@silverwind.io>2015-05-16 07:17:41 +0200
commitd4726cde57856896c560820b89eae0bc08621034 (patch)
tree01e5ec875240d6e0fb9a7b4e8cfba309dd271a44 /test/parallel/test-http-client-timeout.js
parentc7fb91dc1310f9454d4aa8091bcc6d305322a72f (diff)
downloadandroid-node-v8-d4726cde57856896c560820b89eae0bc08621034.tar.gz
android-node-v8-d4726cde57856896c560820b89eae0bc08621034.tar.bz2
android-node-v8-d4726cde57856896c560820b89eae0bc08621034.zip
http,net,tls: return this from setTimeout methods
Modifies the setTimeout methods for the following prototypes: - http.ClientRequest - http.IncomingMessage - http.OutgoingMessage - http.Server - https.Server - net.Socket - tls.TLSSocket Previously, the above functions returned undefined. They now return `this`. This is useful for chaining function calls. PR-URL: https://github.com/nodejs/io.js/pull/1699 Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'test/parallel/test-http-client-timeout.js')
-rw-r--r--test/parallel/test-http-client-timeout.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-http-client-timeout.js b/test/parallel/test-http-client-timeout.js
index 8ea36de41e..a9b093eb0c 100644
--- a/test/parallel/test-http-client-timeout.js
+++ b/test/parallel/test-http-client-timeout.js
@@ -23,7 +23,8 @@ server.listen(options.port, options.host, function() {
function destroy() {
req.destroy();
}
- req.setTimeout(1, destroy);
+ var s = req.setTimeout(1, destroy);
+ assert.ok(s instanceof http.ClientRequest);
req.on('error', destroy);
req.end();
});