Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

should

Package Overview
Dependencies
Maintainers
4
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

should - npm Package Compare versions

Comparing version 3.1.4 to 3.2.0-beta1

18

lib/ext/property.js

@@ -49,10 +49,16 @@ /*!

props = names.map(i);
} else if(this.one) {
props = names.filter(function(name) {
return missingProperties.indexOf(i(name)) < 0;
}).map(i);
}
var operator = (props.length === 1 ?
'to have property ' : 'to have properties ') + props.join(', ');
'to have property ' : 'to have '+(this.one? 'any of ' : '')+'properties ') + props.join(', ');
this.params = { operator: operator };
this.assert(missingProperties.length === 0);
//check that all properties presented
//or if we request one of them that at least one them presented
this.assert(missingProperties.length === 0 || (this.one && missingProperties.length != names.length));

@@ -75,3 +81,3 @@ // check if values in object matched expected

if(wrongValues.length > 0) {
if((wrongValues.length !== 0 && !this.one) || (this.one && props.length === 0)) {
props = wrongValues;

@@ -81,7 +87,9 @@ }

operator = (props.length === 1 ?
'to have property ' : 'to have properties ') + props.join(', ');
'to have property ' : 'to have '+(this.one? 'any of ' : '')+'properties ') + props.join(', ');
this.params = { operator: operator };
this.assert(wrongValues.length === 0);
//if there is no not matched values
//or there is at least one matched
this.assert(wrongValues.length === 0 || (this.one && wrongValues.length != valueCheckNames.length));
}

@@ -88,0 +96,0 @@ });

@@ -45,2 +45,3 @@ /*!

context.copy = context.copyIfMissing;
context.one = this.one;

@@ -168,4 +169,14 @@ try {

return this;
},
/**
* Any modifier - it affect on execution of sequenced assertion to do not check all, but any of
*
* @api public
*/
get any() {
this.one = true;
return this;
}
};
{
"name": "should",
"description": "test framework agnostic BDD-style assertions",
"version": "3.1.4",
"version": "3.2.0-beta1",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -6,0 +6,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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