diff --git a/tests/pr.test.js b/tests/pr.test.js index ecfe7605e5..a590b0b4c8 100644 --- a/tests/pr.test.js +++ b/tests/pr.test.js @@ -3,7 +3,7 @@ const fs = require("fs-extra"); const path = require("path"); const PR_AUTHOR = process.env.PR_AUTHOR; -const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map(file => file.replace(/^domains\//, "")); +const MODIFIED_FILES = (process.env.MODIFIED_FILES || "").split(" ").map((file) => file.replace(/^domains\//, "")); const EVENT = process.env.EVENT; const RUN_ID = process.env.RUN_ID; @@ -47,9 +47,11 @@ 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); - + const newFiles = domainsPath.filter((file) => !fs.existsSync(path.join(headDomainsFiles, file))); + console.log(newFiles); + await Promise.all( newFiles.map(async (file) => { const domain = await getFileContent(domainsPath, file);