exports.js 689 B

12345678910111213141516171819202122
  1. var assert = require('assert')
  2. , validator = require('../validator');
  3. describe('Exports', function () {
  4. it('should export validators', function () {
  5. assert.equal(typeof validator.isEmail, 'function');
  6. assert.equal(typeof validator.isAlpha, 'function');
  7. });
  8. it('should export sanitizers', function () {
  9. assert.equal(typeof validator.toBoolean, 'function');
  10. assert.equal(typeof validator.toFloat, 'function');
  11. });
  12. it('should export the version number', function () {
  13. assert.equal(validator.version, require('../package.json').version,
  14. 'Version number mismatch in "package.json" vs. "validator.js"');
  15. });
  16. });