summaryrefslogtreecommitdiff
path: root/test/parallel/test-gc-http-client-onerror.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2018-08-21 13:38:59 -0700
committerJames M Snell <jasnell@gmail.com>2018-08-24 10:32:09 -0700
commitd495e40bf7c75c689df75b09ae1bf9a92f3eb584 (patch)
treee1616a74cf3ebb3062332fffe7d7c50766a825cb /test/parallel/test-gc-http-client-onerror.js
parent3579ec4171734fea65e52d385594a35a40bcde8f (diff)
downloadandroid-node-v8-d495e40bf7c75c689df75b09ae1bf9a92f3eb584.tar.gz
android-node-v8-d495e40bf7c75c689df75b09ae1bf9a92f3eb584.tar.bz2
android-node-v8-d495e40bf7c75c689df75b09ae1bf9a92f3eb584.zip
test: move common.onGC to individual module
Incrementally making `require('../common')` less of a monolith. Move the `common.onGC()` utility to a separate standalone module that is only imported when it's actually needed. PR-URL: https://github.com/nodejs/node/pull/22446 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test/parallel/test-gc-http-client-onerror.js')
-rw-r--r--test/parallel/test-gc-http-client-onerror.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/parallel/test-gc-http-client-onerror.js b/test/parallel/test-gc-http-client-onerror.js
index 8842da93c3..ef643d255e 100644
--- a/test/parallel/test-gc-http-client-onerror.js
+++ b/test/parallel/test-gc-http-client-onerror.js
@@ -3,7 +3,8 @@
// just like test-gc-http-client.js,
// but with an on('error') handler that does nothing.
-const common = require('../common');
+require('../common');
+const onGC = require('../common/ongc');
function serverHandler(req, res) {
req.resume();
@@ -42,7 +43,7 @@ function getall() {
}, cb).on('error', onerror);
count++;
- common.onGC(req, { ongc });
+ onGC(req, { ongc });
})();
setImmediate(getall);