diff --git a/test/src/files/correct.test.ts b/test/src/files/correct.test.ts index df57f85c..269e12ec 100644 --- a/test/src/files/correct.test.ts +++ b/test/src/files/correct.test.ts @@ -16,6 +16,17 @@ describe("test correct files", () => { it(testfolder, () => { let result = validator.ValidateFile(file); + 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( (succes) => { expect(succes.length, "Expected no errors got: " + JSON.stringify(succes)).to.equal(0); @@ -25,7 +36,7 @@ describe("test correct files", () => { } ); - return result.promise; + return Promise.all([result.promise, schemas]); }); } }); diff --git a/test/src/files/incorrect.test.ts b/test/src/files/incorrect.test.ts index 103cef7e..d559aebf 100644 --- a/test/src/files/incorrect.test.ts +++ b/test/src/files/incorrect.test.ts @@ -16,6 +16,17 @@ describe("test incorrect files", () => { it(testfolder, () => { let result = validator.ValidateFile(file); + 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( (succes) => { expect(succes.length, "Expected errors! but had none").to.greaterThan(0); @@ -25,7 +36,7 @@ describe("test incorrect files", () => { } ); - return result.promise; + return Promise.all([schemas, result]); }); } });