can-validate-validatejs
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "can-validate-validatejs", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Create validator functions that use ValidateJS to validate values.", | ||
@@ -49,5 +49,5 @@ "main": "can-validate-validatejs.js", | ||
"steal": "^1.0.8", | ||
"steal-qunit": "^1.0.0", | ||
"steal-qunit": "^2.0.0", | ||
"steal-tools": "^1.0.1", | ||
"testee": "^0.8.0" | ||
"testee": "^0.9.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "steal": { |
# can-validate-validatejs | ||
[](https://gitter.im/canjs/canjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[](https://github.com/canjs/can-validate-validatejs/blob/master/LICENSE.md) | ||
[](https://www.bitovi.com/community/slack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[](https://forums.bitovi.com/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[](https://github.com/canjs/can-validate-validatejs/blob/master/LICENSE.md) | ||
[](https://www.npmjs.com/package/can-validate-validatejs) | ||
[](https://travis-ci.org/canjs/can-validate-validatejs) | ||
[](https://ci.appveyor.com/project/matthewp/can-validate-validatejs) | ||
[](https://coveralls.io/github/canjs/can-validate-validatejs?branch=master) | ||
[](https://greenkeeper.io/) | ||
@@ -28,2 +27,1 @@ | ||
[MIT](https://github.com/canjs/can-validate-validatejs/blob/master/LICENSE.md) | ||
16
test.js
@@ -29,16 +29,16 @@ var QUnit = require('steal-qunit'); | ||
QUnit.test('makeValidator sets errors',function(){ | ||
QUnit.test('makeValidator sets errors',function(assert){ | ||
var validateAge = makeValidator(constraints.age); | ||
var errors = validateAge(invalidPerson.age); | ||
var expectedErrors = [constraints.age.numericality.message]; | ||
QUnit.deepEqual(errors, expectedErrors, 'returns expected errors object'); | ||
assert.deepEqual(errors, expectedErrors, 'returns expected errors object'); | ||
}); | ||
QUnit.test('makeValidator validates',function(){ | ||
QUnit.test('makeValidator validates',function(assert){ | ||
var validateAge = makeValidator(constraints.age); | ||
var errors = validateAge(validPerson.age); | ||
QUnit.notOk(errors, 'value is valid, so no errors return'); | ||
assert.notOk(errors, 'value is valid, so no errors return'); | ||
}); | ||
QUnit.test('makeValidator.many sets errors',function(){ | ||
QUnit.test('makeValidator.many sets errors',function(assert){ | ||
var validatePerson = makeValidator.many(constraints); | ||
@@ -55,9 +55,9 @@ var errors = validatePerson(invalidPerson); | ||
]; | ||
QUnit.deepEqual(errors, expectedErrors, 'Many errors are set'); | ||
assert.deepEqual(errors, expectedErrors, 'Many errors are set'); | ||
}); | ||
QUnit.test('makeValidator.many validates',function(){ | ||
QUnit.test('makeValidator.many validates',function(assert){ | ||
var validatePerson = makeValidator.many(constraints); | ||
var errors = validatePerson(validPerson); | ||
QUnit.notOk(errors, 'values are valid, so no errors return'); | ||
assert.notOk(errors, 'values are valid, so no errors return'); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14629
27