From 25613ca391370e0ad3916a90860d9a8fb6f4f571 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 5 Aug 2021 23:18:59 -0400 Subject: [PATCH] fs: add recursive cp method Co-authored-by: Antoine du Hamel --- test/parallel/test-fs-cp.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-fs-cp.mjs b/test/parallel/test-fs-cp.mjs index eaba96abce2c80..804b5a1f4c322c 100644 --- a/test/parallel/test-fs-cp.mjs +++ b/test/parallel/test-fs-cp.mjs @@ -753,11 +753,11 @@ function assertDirEquivalent(dir1, dir2) { } function collectEntries(dir, dirEntries) { - const newEntries = [...readdirSync(dir, { withFileTypes: true })]; + const newEntries = readdirSync(dir, { withFileTypes: true }); for (const entry of newEntries) { if (entry.isDirectory()) { collectEntries(join(dir, entry.name), dirEntries); } } - dirEntries.push.apply(dirEntries, newEntries); + dirEntries.push(...newEntries); }