Update validate-json.test.ts

This commit is contained in:
CanbiZ 2025-03-12 12:57:12 +01:00 committed by GitHub
parent 388d6e4f3c
commit 80f4243cda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,13 +11,18 @@ const encoding = "utf-8";
let fileNames: string[] = []; let fileNames: string[] = [];
try { try {
// Prüfen, ob das Verzeichnis existiert, falls nicht, Tests überspringen
fileNames = (await fs.readdir(jsonDir)).filter((fileName) => fileName !== metadataFileName); fileNames = (await fs.readdir(jsonDir)).filter((fileName) => fileName !== metadataFileName);
} catch (error) { } catch (error) {
console.warn(`Skipping JSON validation tests: ${error.message}`); console.warn(`Skipping JSON validation tests: ${error.message}`);
} }
if (fileNames.length > 0) { if (fileNames.length === 0) {
describe("Dummy Test Suite", () => {
it("Skipping JSON tests because no files were found", () => {
assert(true);
});
});
} else {
describe.each(fileNames)("%s", async (fileName) => { describe.each(fileNames)("%s", async (fileName) => {
let script: Script; let script: Script;
@ -61,6 +66,4 @@ if (fileNames.length > 0) {
}); });
}); });
}); });
} else {
console.warn("Skipping tests because no JSON files were found.");
} }