From 0132cddb6f4cc7797c127438378a39cce7aa930f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 28 Nov 2019 23:15:25 -0800 Subject: 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(-) (limited to 'test') diff --git a/test/sequential/test-http-max-http-headers.js b/test/sequential/test-http-max-http-headers.js index f54d238548..39f5033f06 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))); }); } -- cgit v1.2.3