Valido — A helper library for form validation built on top of .@chriso's validator.js
-
Clone the repository:
$ git clone https://github.com/giovanni0918/valido.git
-
Navigate into the valido folder:
$ cd valido
-
Install deps using npm:
$ npm install
-
Test using jest
$ npm run jest
const Valido = require("../lib/Valido.util");
const expect = require('expect');
test('String does not meet specified length', () => {
const username = "bass";
const { valid, errors } = Valido.validateProperLength({
value: username,
minLength: 8,
maxLength: 15
});
expect(errors.length).toBeGreaterThan(0);
expect(valid).toEqual(false);
});