Joi-with-Jest
This is a matchers that can be used with Jest testing framework to test any Json/Javascript schema with Joi
Install
$ npm install joi-with-jest
Usage
const matchers = ;expect;
and to validate your JSON or Javascript schema you can do
//Joi schema definition let customer = Joiobject; let options = abortEarly: false stripUnknown: false ;
And if any test fails, it will throw errors like
"message":"\"firstName\" is required""path":"ascUser""firstName""validationFailed":"required"