data-validation
Advanced tools
Comparing version 0.5.3 to 0.5.5
{ | ||
"name": "data-validation", | ||
"version": "0.5.3", | ||
"version": "0.5.5", | ||
"dependencies": {}, | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
if(typeof module != 'undefined') { | ||
if(typeof module !== 'undefined' && module.exports) { | ||
var _ = require('lodash'); | ||
@@ -14,3 +14,3 @@ } | ||
var test = value; | ||
return (test != 0 && test != undefined); | ||
return (test !== '' && test !== undefined && test !== null); | ||
}, | ||
@@ -87,4 +87,4 @@ | ||
if(typeof module != 'undefined') { | ||
if(typeof module !== 'undefined' && module.exports) { | ||
module.exports = dataValidation; | ||
} |
@@ -5,3 +5,7 @@ module.exports = function(config) { | ||
basePath: '..', | ||
frameworks: ['jasmine'], | ||
frameworks: [ | ||
'mocha', | ||
'chai', | ||
'sinon' | ||
], | ||
browsers: ['PhantomJS'], | ||
@@ -12,3 +16,3 @@ singleRun: true, | ||
'components/lodash/dist/lodash.js', | ||
'tests/*.js', | ||
'test/*.spec.js', | ||
'*.js' | ||
@@ -15,0 +19,0 @@ ] |
{ | ||
"name": "data-validation", | ||
"version": "0.5.3", | ||
"version": "0.5.5", | ||
"description": "Data validation for JavaScript", | ||
@@ -26,5 +26,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"karma": "0.12.16", | ||
"karma": "0.12.23", | ||
"karma-phantomjs-launcher": "0.1.4", | ||
"mocha": "1.18.2", | ||
"karma-mocha": "0.1.9", | ||
"karma-chai": "0.1.0", | ||
"karma-sinon": "1.0.3", | ||
"mocha": "1.20.1", | ||
"sinon": "1.10.3", | ||
"chai": "1.9.1" | ||
@@ -31,0 +35,0 @@ }, |
@@ -1,5 +0,5 @@ | ||
var expect = require('chai').expect; | ||
var dataValidation = require('../data-validation'); | ||
describe('Data Validation', function() { | ||
var dataValidation = require('../data-validation'); | ||
var expect = require('chai').expect; | ||
describe('Data Validation', function(){ | ||
describe("Basic Functionality", function() { | ||
@@ -30,2 +30,6 @@ it('should be able to add a validator', function() { | ||
it('should validate 0 as not empty', function() { | ||
expect(dataValidation.validate('notEmpty', 0)).to.be.true; | ||
}); | ||
it('should validate 20 as not less than 10', function() { | ||
@@ -32,0 +36,0 @@ expect(dataValidation.validate('minValue', 20, 10)).to.be.true; |
9353
8
11
201