From d69b9b753a908d740c66ff50e890dccaa0e78c46 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 28 Nov 2019 23:15:25 -0800 Subject: [PATCH] test: simplify forEach() usage Use an array literal instead of using split() on a very short string. PR-URL: https://github.com/nodejs/node/pull/30712 Reviewed-By: David Carlier Reviewed-By: Luigi Pinca --- test/sequential/test-http-max-http-headers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequential/test-http-max-http-headers.js b/test/sequential/test-http-max-http-headers.js index f54d23854801cc..39f5033f0605f6 100644 --- a/test/sequential/test-http-max-http-headers.js +++ b/test/sequential/test-http-max-http-headers.js @@ -24,7 +24,7 @@ function once(cb) { } function finished(client, callback) { - 'abort error end'.split(' ').forEach((e) => { + ['abort', 'error', 'end'].forEach((e) => { client.on(e, once(() => setImmediate(callback))); }); }