From 5bb7bf37676647aa911715ede542eda4af6ef827 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 2959a4ff9c3407..e2719f923a694a 100644 --- a/test/sequential/test-http-max-http-headers.js +++ b/test/sequential/test-http-max-http-headers.js @@ -25,7 +25,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))); }); }