From aa64d4197942fae252717a1f1805029ee8ff90c7 Mon Sep 17 00:00:00 2001 From: dhrumit parmar Date: Mon, 22 Jul 2024 18:36:23 +0530 Subject: [PATCH] Fixing testing logic --- tests/github-discussion-schema.test.mjs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/github-discussion-schema.test.mjs b/tests/github-discussion-schema.test.mjs index 8acec43b..a5efdd77 100644 --- a/tests/github-discussion-schema.test.mjs +++ b/tests/github-discussion-schema.test.mjs @@ -26,14 +26,13 @@ const filesInDir = fs filesInDir.forEach((file) => { const content = fs.readFileSync(join(GH_DATA, file)).toString(); - if (content === "null") { - process.exit(1); - } - const data = JSON.parse(stripJsonComments(content)); + if (content !== "null") { + const data = JSON.parse(stripJsonComments(content)); - describe(`Validate '${file}'`, function () { - it("should be properly validated by the json schema", () => { - expect(data).to.be.jsonSchema(schema); + describe(`Validate '${file}'`, function () { + it("should be properly validated by the json schema", () => { + expect(data).to.be.jsonSchema(schema); + }); }); - }); + } });