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

unexpected

Package Overview
Dependencies
Maintainers
2
Versions
330
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected - npm Package Compare versions

Comparing version 5.0.0-beta8 to 5.0.0-beta9

24

lib/assertions.js

@@ -507,2 +507,21 @@ var utils = require('./utils');

expect.addAssertion('Error', 'to [exhaustively] satisfy [assertion]', function (expect, subject, value) {
var valueType = expect.findTypeOf(value);
if (valueType.is('Error')) {
expect(subject, 'to equal', value);
} else if (valueType.is('object')) {
var keys = valueType.getKeys(value);
keys.forEach(function (key) {
expect(subject[key], 'to [exhaustively] satisfy', value[key]);
});
if (this.flags.exhaustively) {
expect(utils.getKeysOfDefinedProperties(subject), 'to have length', keys.filter(function (key) {
return typeof value[key] !== 'undefined';
}).length);
}
} else {
expect(subject.message, 'to [exhaustively] satisfy', value);
}
});
expect.addAssertion('[not] to [exhaustively] satisfy [assertion]', function (expect, subject, value) {

@@ -532,7 +551,8 @@ if (this.flags.not) {

expect(subject, 'to be an object');
type.getKeys(value).forEach(function (key) {
var keys = type.getKeys(value);
keys.forEach(function (key) {
expect(subject[key], 'to [exhaustively] satisfy', value[key]);
});
if (this.flags.exhaustively) {
expect(subject, 'to only have keys', Object.keys(value));
expect(subject, 'to only have keys', keys);
}

@@ -539,0 +559,0 @@ } catch (e) {

2

package.json
{
"name": "unexpected",
"version": "5.0.0-beta8",
"version": "5.0.0-beta9",
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>",

@@ -5,0 +5,0 @@ "keywords": [

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

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

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