Updated
This commit is contained in:
@@ -18,14 +18,17 @@ describe("test correct files", () => {
|
|||||||
const schemas = validator.ls.getMatchingSchemas(result.doc, result.jdoc);
|
const schemas = validator.ls.getMatchingSchemas(result.doc, result.jdoc);
|
||||||
|
|
||||||
it("validation", () => {
|
it("validation", () => {
|
||||||
return result.promise.then(
|
result.promise.then(
|
||||||
(succes) => {
|
(succes) => {
|
||||||
expect(succes.length, "Expected no errors got: " + JSON.stringify(succes)).to.equal(0);
|
expect(succes.length, "Expected no errors got: " + succes.length).to.equal(0);
|
||||||
|
succes.forEach((item) => console.log(item.message));
|
||||||
},
|
},
|
||||||
(fail) => {
|
(fail) => {
|
||||||
expect.fail("Failed to validate");
|
expect.fail("Failed to validate");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return result.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
it("schemas", () => {
|
it("schemas", () => {
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ describe("test incorrect files", () => {
|
|||||||
if (file.endsWith(".json")) {
|
if (file.endsWith(".json")) {
|
||||||
const testfolder = file.replace(folder + "/", "");
|
const testfolder = file.replace(folder + "/", "");
|
||||||
|
|
||||||
it(testfolder, () => {
|
describe(testfolder, () => {
|
||||||
let result = validator.ValidateFile(file);
|
const result = validator.ValidateFile(file);
|
||||||
|
const schemas = validator.ls.getMatchingSchemas(result.doc, result.jdoc);
|
||||||
|
|
||||||
let schemas = validator.ls.getMatchingSchemas(result.doc, result.jdoc);
|
it("schemas", () => {
|
||||||
|
return schemas.then(
|
||||||
schemas.then(
|
|
||||||
(success) => {
|
(success) => {
|
||||||
expect(success.length, "Expected schemas to be returned").to.greaterThan(0);
|
expect(success.length, "Expected schemas to be returned").to.greaterThan(0);
|
||||||
},
|
},
|
||||||
@@ -26,7 +26,9 @@ describe("test incorrect files", () => {
|
|||||||
expect.fail("failed on retrieving schemas");
|
expect.fail("failed on retrieving schemas");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("validation", () => {
|
||||||
result.promise.then(
|
result.promise.then(
|
||||||
(succes) => {
|
(succes) => {
|
||||||
expect(succes.length, "Expected errors! but had none").to.greaterThan(0);
|
expect(succes.length, "Expected errors! but had none").to.greaterThan(0);
|
||||||
@@ -36,6 +38,9 @@ describe("test incorrect files", () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return result.promise;
|
||||||
|
});
|
||||||
|
|
||||||
return Promise.all([schemas, result]);
|
return Promise.all([schemas, result]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user