validatable
Version:
A library for synchronous and asynchronous input validation.
15 lines (11 loc) • 327 B
JavaScript
import test from 'ava';
import { stringLowercase } from '../../dist/validators';
test('fails when not a string', (t) => {
t.is(stringLowercase(true), false);
});
test('fails when invalid', (t) => {
t.is(stringLowercase('Hello'), false);
});
test('passes when valid', (t) => {
t.is(stringLowercase('hello'), true);
});