Initial commit

This commit is contained in:
Luis Fernando Molina committed 2018-02-07 21:05:26 +01:00
commit ec49fedc45
1288 files changed
+226749

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
var assert = require('assert')
, validator = require('../validator')
, min = require('../validator.min');
describe('Minified version', function () {
it('should export the same things as the server-side version', function () {
for (var key in validator) {
assert.equal(typeof validator[key], typeof min[key], 'Minified version did not export ' + key);
}
});
it('should be up to date', function () {
assert.equal(min.version, validator.version, 'Minified version mismatch. Run `make min`');
});
it('should validate strings', function () {
assert.equal(min.isEmail('foo@bar.com'), true);
assert.equal(min.isEmail('foo'), false);
});
it('should sanitize strings', function () {
assert.equal(min.toBoolean('1'), true);
});
});