From d3c928e900f8986aef215769a3d765c22c112fd5 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:04:44 +0800 Subject: [PATCH] Update pr.test.js --- tests/pr.test.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/pr.test.js b/tests/pr.test.js index 9013d173d..2d2f5123b 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -43,21 +43,22 @@ t("Modified JSON files must be owned by the PR author", async (t) => { ); }) ); + + t.pass(); }); t("New JSON files must be owned by the PR author", async (t) => { - if (EVENT !== "pull_request") { - t.pass(); - return; - } + if (EVENT !== "pull_request") return t.pass(); const domainsFiles = await fs.readdir(domainsPath); - const headDomainsFiles = await fs.readdir(headDomainsPath).catch(() => []); + const headDomainsFiles = await fs.readdir(headDomainsPath); const newFiles = domainsFiles.filter( (file) => !headDomainsFiles.includes(file.substring(file.lastIndexOf("/") + 1)) ); + console.log("New files", newFiles); + await Promise.all( newFiles.map(async (file) => { const domain = await getFileContent(domainsPath, file); @@ -73,4 +74,6 @@ t("New JSON files must be owned by the PR author", async (t) => { ); }) ); + + t.pass(); });