Last active
February 21, 2018 08:58
-
-
Save ealush/34cd418a334ecb70cbc45c4b7c9f008f to your computer and use it in GitHub Desktop.
passable-example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import passable, { enforce } from passable; | |
| passable('new_user_form', (test) => { | |
| test('username', 'Must be between 5 and 20 chars', () => { | |
| enforce(username).allOf({ | |
| largerThan: 4, | |
| smallerThan: 20 | |
| }); | |
| }); | |
| test('age', 'You must be over 13 to register', () => { | |
| enforce(age).isNumber().largerThan(13); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment