json-schema-validator-async
An async JSON schema validator compatible with $ref file dependencies and angular 2+ karma
How to integrate with angular 2+ and karma
- expose json folder by updating the file
karma.conf.js
...files: ... pattern: 'schemas/*.json' server: true included: false watched: true ......
- use it in the .spec.ts:
;schema1Validator = new JsonSchemaValidator;...it'shoud have the valid schema';
Note that the path
has the prefix base/
.
Also note that async function is not trully async
, done
method does the best job.
On fail you will see the errors json.