mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 14:25:53 +00:00
Update validate-json.test.ts
This commit is contained in:
@@ -11,13 +11,18 @@ const encoding = "utf-8";
|
||||
let fileNames: string[] = [];
|
||||
|
||||
try {
|
||||
// Prüfen, ob das Verzeichnis existiert, falls nicht, Tests überspringen
|
||||
fileNames = (await fs.readdir(jsonDir)).filter((fileName) => fileName !== metadataFileName);
|
||||
} catch (error) {
|
||||
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) => {
|
||||
let script: Script;
|
||||
|
||||
@@ -61,6 +66,4 @@ if (fileNames.length > 0) {
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.warn("Skipping tests because no JSON files were found.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user