This commit is contained in:
DaanV2
2021-10-04 12:04:05 +02:00
parent b327747d95
commit 0e0b102c82

View File

@@ -13,21 +13,12 @@ describe("test correct files", () => {
if (file.endsWith(".json")) {
const testfolder = file.replace(folder + "/", "");
it(testfolder, () => {
let result = validator.ValidateFile(file);
describe(testfolder, () => {
const result = validator.ValidateFile(file);
const schemas = validator.ls.getMatchingSchemas(result.doc, result.jdoc);
let schemas = validator.ls.getMatchingSchemas(result.doc, result.jdoc);
schemas.then(
(success) => {
expect(success.length, "Expected schemas to be returned").to.greaterThan(0);
},
(fail) => {
expect.fail("failed on retrieving schemas");
}
);
result.promise.then(
it("validation", () => {
return result.promise.then(
(succes) => {
expect(succes.length, "Expected no errors got: " + JSON.stringify(succes)).to.equal(0);
},
@@ -35,6 +26,18 @@ describe("test correct files", () => {
expect.fail("Failed to validate");
}
);
});
it("schemas", () => {
return schemas.then(
(success) => {
expect(success.length, "Expected schemas to be returned").to.greaterThan(0);
},
(fail) => {
expect.fail("failed on retrieving schemas");
}
);
});
return Promise.all([result.promise, schemas]);
});