From f8581e76293db75074fc3fa0ed08d934c8f14dd3 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 25 Apr 2023 12:03:51 -0400 Subject: [PATCH] test_runner: remove no-op validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code already checks if testNamePatterns is an array, and converts it to an array if it is not. PR-URL: https://github.com/nodejs/node/pull/47687 Reviewed-By: Michaƫl Zasso Reviewed-By: Benjamin Gruenbaum Reviewed-By: Moshe Atlow Reviewed-By: Debadree Chatterjee Reviewed-By: Luigi Pinca Reviewed-By: Deokjin Kim --- lib/internal/test_runner/runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/test_runner/runner.js b/lib/internal/test_runner/runner.js index 27be4829581b56..45fb830a982fd8 100644 --- a/lib/internal/test_runner/runner.js +++ b/lib/internal/test_runner/runner.js @@ -391,7 +391,7 @@ function run(options) { if (!ArrayIsArray(testNamePatterns)) { testNamePatterns = [testNamePatterns]; } - validateArray(testNamePatterns, 'options.testNamePatterns'); + testNamePatterns = ArrayPrototypeMap(testNamePatterns, (value, i) => { if (isRegExp(value)) { return value;