From 0c5b45f901476ae08da4d756a4cb6592aacaf40f Mon Sep 17 00:00:00 2001 From: Jon <66625200+Kyro3400@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:05:49 -0500 Subject: [PATCH] Update json.test.js --- tests/json.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/json.test.js b/tests/json.test.js index f1bd162c..1617282c 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -42,6 +42,12 @@ function validateOptionalFields(t, obj, optionalFields, file) { } t("All files should be valid JSON", (t) => { + const reservedFiles = fs.existsSync(reservedDomainsPath) + ? fs.readdirSync(reservedDomainsPath).filter(file => { + const filePath = path.join(reservedDomainsPath, file); + return fs.lstatSync(filePath).isFile(); // Only include files + }) + : []; files.forEach((file) => { t.notThrows(() => fs.readJsonSync(path.join(domainsPath, file)), `${file}: Invalid JSON file`); });