From 70dd4633a45dcbd29ba38245f326bafae1b20749 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:25:34 +0800 Subject: [PATCH] Update pr.test.js --- tests/pr.test.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 2be0b763d..f4a5a2cce 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -50,12 +50,9 @@ t("New JSON files must be owned by the PR author", async (t) => { if (EVENT !== "pull_request") return t.pass(); const headDomainsFiles = fs.readdirSync(headDomainsPath); - - console.log("Head files", headDomainsFiles.filter((file) => MODIFIED_FILES.includes(`domains/${file}`))); - - console.log("Modified files", MODIFIED_FILES.map((file) => file.substring(file.lastIndexOf("/") + 1))); - - const newFiles = MODIFIED_FILES.map((file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1))); + + // get list of all files that are in the base dir but not in the head dir + const newFiles = headDomainsFiles.filter((file) => !fs.existsSync(path.join(domainsPath, file))); console.log("New files", newFiles);