New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

can-validate-legacy

Package Overview
Dependencies
Maintainers
8
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-validate-legacy - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

38

can-validate-test.js

@@ -43,15 +43,15 @@ /* jshint asi: false */

QUnit.test("when validateOnInit is not set, it should not run validation",function(){
QUnit.test("when validateOnInit is not set, it should not run validation",function(assert) {
validatedMap = new ValidatedMap();
QUnit.ok(isEmptyObject(validatedMap.errors));
assert.ok(isEmptyObject(validatedMap.errors));
});
QUnit.test("validations run when value is set",function(){
QUnit.test("validations run when value is set",function(assert) {
validatedMap = new ValidatedMap();
validatedMap.attr("myNumber", "");
QUnit.equal(validatedMap.errors.myNumber.length, 1);
assert.equal(validatedMap.errors.myNumber.length, 1);
});
// #27 - Validate method does not resolve computes
QUnit.test("when validate method is called, resolves computes before calling Validate method",function(){
QUnit.test("when validate method is called, resolves computes before calling Validate method",function(assert) {
validatedMap = new ValidatedMap({

@@ -68,3 +68,3 @@ isRequired: true,

}
QUnit.ok(success);
assert.ok(success);
});

@@ -78,3 +78,3 @@

*/
QUnit.test("when creating multiple instances of the same map, each instance is discrete",function(){
QUnit.test("when creating multiple instances of the same map, each instance is discrete",function(assert) {
// Doing this should not affect our control. If bug exists, it will

@@ -89,8 +89,8 @@ // affect all instances

secondaryMap.attr("computedProp", "");
QUnit.equal(isEmptyObject(secondaryMap.attr("errors")), true, 'control map validates successfully');
assert.equal(isEmptyObject(secondaryMap.attr("errors")), true, 'control map validates successfully');
// other map validates, sets error
validatedMap.attr("computedProp", "");
QUnit.equal(validatedMap.attr("computedProp"), "");
QUnit.ok(typeof validatedMap.attr("errors.computedProp") !== "undefined", 'other map validates, sets error');
assert.equal(validatedMap.attr("computedProp"), "");
assert.ok(typeof validatedMap.attr("errors.computedProp") !== "undefined", 'other map validates, sets error');
});

@@ -119,3 +119,3 @@

QUnit.module("Validate.js Shim", {
setup: function(){
beforeEach: function(assert) {
validatedMap = new ShimValidatedMap({});

@@ -125,17 +125,17 @@ }

QUnit.test("validates on init by default",function(){
QUnit.equal(validatedMap.attr('errors').myNumber.length, 1);
QUnit.test("validates on init by default",function(assert) {
assert.equal(validatedMap.attr('errors').myNumber.length, 1);
});
QUnit.test("validates on init by default",function(){
QUnit.equal(validatedMap.errors.myNumber.length, 1);
QUnit.test("validates on init by default",function(assert) {
assert.equal(validatedMap.errors.myNumber.length, 1);
});
QUnit.test("does not validate on init, when validate on init is false",function(){
QUnit.equal(validatedMap.errors.myString, undefined);
QUnit.test("does not validate on init, when validate on init is false",function(assert) {
assert.equal(validatedMap.errors.myString, undefined);
});
QUnit.test("runs validation on value",function(){
QUnit.test("runs validation on value",function(assert) {
validatedMap.attr("myString", "");
QUnit.equal(validatedMap.errors.myString.length, 1);
assert.equal(validatedMap.errors.myString.length, 1);
});

@@ -1,2 +0,2 @@

/*can-validate-legacy@2.0.0#can-validate*/
/*can-validate-legacy@2.0.1#can-validate*/
define([

@@ -3,0 +3,0 @@ 'require',

@@ -1,2 +0,2 @@

/*can-validate-legacy@2.0.0#map/validate/validate*/
/*can-validate-legacy@2.0.1#map/validate/validate*/
define([

@@ -3,0 +3,0 @@ 'require',

@@ -1,2 +0,2 @@

/*can-validate-legacy@2.0.0#shims/validatejs*/
/*can-validate-legacy@2.0.1#shims/validatejs*/
define([

@@ -3,0 +3,0 @@ 'require',

@@ -1,2 +0,2 @@

/*can-validate-legacy@2.0.0#can-validate*/
/*can-validate-legacy@2.0.1#can-validate*/
'use strict';

@@ -3,0 +3,0 @@ var dev = require('can-log/dev/dev');

@@ -1,2 +0,2 @@

/*can-validate-legacy@2.0.0#map/validate/validate*/
/*can-validate-legacy@2.0.1#map/validate/validate*/
'use strict';

@@ -3,0 +3,0 @@ var assign = require('can-assign');

@@ -1,2 +0,2 @@

/*can-validate-legacy@2.0.0#shims/validatejs*/
/*can-validate-legacy@2.0.1#shims/validatejs*/
'use strict';

@@ -3,0 +3,0 @@ var validate = require('../can-validate.js');

@@ -167,3 +167,3 @@ /*[process-shim]*/

/*can-validate-legacy@2.0.0#can-validate*/
/*can-validate-legacy@2.0.1#can-validate*/
define('can-validate-legacy', [

@@ -203,3 +203,3 @@ 'require',

});
/*can-validate-legacy@2.0.0#map/validate/validate*/
/*can-validate-legacy@2.0.1#map/validate/validate*/
define('can-validate-legacy/map/validate/validate', [

@@ -413,3 +413,3 @@ 'require',

});
/*can-validate-legacy@2.0.0#shims/validatejs*/
/*can-validate-legacy@2.0.1#shims/validatejs*/
define('can-validate-legacy/shims/validatejs', [

@@ -416,0 +416,0 @@ 'require',

{
"name": "can-validate-legacy",
"version": "2.0.0",
"version": "2.0.1",
"main": "can-validate.js",

@@ -45,6 +45,6 @@ "description": "Validation plugin for CanJS that provides an abstraction layer to your validation library of choice (Shim may be required).",

"steal": "^1.2.10",
"steal-qunit": "^1.0.1",
"steal-qunit": "^2.0.0",
"steal-stache": "^3.0.1",
"steal-tools": "^1.1.2",
"testee": "^0.8.0"
"testee": "^0.9.0"
},

@@ -51,0 +51,0 @@ "browser": {

# can-validate-legacy
[![Join the chat at https://gitter.im/canjs/canjs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/canjs/canjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/canjs/can-validate-legacy/blob/master/LICENSE.md)
[![Join our Slack](https://img.shields.io/badge/slack-join%20chat-611f69.svg)](https://www.bitovi.com/community/slack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join our Discourse](https://img.shields.io/discourse/https/forums.bitovi.com/posts.svg)](https://forums.bitovi.com/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/canjs/can-validate-legacy/blob/master/LICENSE.md)
[![npm version](https://badge.fury.io/js/can-validate-legacy.svg)](https://www.npmjs.com/package/can-validate-legacy)
[![Travis build status](https://travis-ci.org/canjs/can-validate-legacy.svg?branch=master)](https://travis-ci.org/canjs/can-validate-legacy)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/canjs/can-validate-legacy?branch=master&svg=true)](https://ci.appveyor.com/project/matthewp/can-validate-legacy)
[![Coverage status](https://coveralls.io/repos/github/canjs/can-validate-legacy/badge.svg?branch=master)](https://coveralls.io/github/canjs/can-validate-legacy?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/canjs/can-validate-legacy.svg)](https://greenkeeper.io/)

@@ -28,2 +27,1 @@

[MIT](https://github.com/canjs/can-validate-legacy/blob/master/LICENSE.md)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc