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

assertive

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assertive - npm Package Compare versions

Comparing version 2.3.5 to 2.4.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### 2.4.0
* stop diffing internally; lean on mocha - **[@dbushong](https://github.com/dbushong)** [#40](https://github.com/groupon/assertive/pull/40)
- [`74beefa`](https://github.com/groupon/assertive/commit/74beefae671795e09bae68c107114456fd3b14a3) **feat:** stop diffing internally; lean on mocha
### 2.3.5

@@ -2,0 +8,0 @@

23

lib/assertive.js

@@ -48,5 +48,2 @@ /*

// may be stubbed out for browsers
var jsDiff = require('diff');
var toString = Object.prototype.toString;

@@ -70,7 +67,9 @@

function error(message, explanation) {
function error(message, explanation, errProps) {
if (explanation != null) {
message = 'Assertion failed: ' + explanation + '\n' + clear + message;
}
return new Error(message);
var err = new Error(message);
if (errProps) _.assign(err, errProps);
return err;
}

@@ -271,3 +270,3 @@

} else if (expected !== actual) {
throw error('Expected: ' + green(stringify(expected)) + '\nActually: ' + ('' + red(stringify(actual))), explanation);
throw error('Expected: ' + green(stringify(expected)) + '\nActually: ' + ('' + red(stringify(actual))), explanation, { actual: actual, expected: expected });
}

@@ -296,14 +295,6 @@ },

} else {
var values = jsDiff.diffJson(actual, expected).map(function (entry) {
var value = entry.value;
var prefix = ' ';
if (entry.added) prefix = '+ ';else if (entry.removed) prefix = '- ';
value = value.replace(/^/gm, prefix).replace(/\n..$/, '');
if (entry.added) value = green(value);else if (entry.removed) value = red(value);
return value;
});
message = 'Actual: ' + red('-') + ' Expected: ' + green('+') + '\n' + values.join('\n');
message = 'Expected: ' + wrongLooks + ' to deepEqual ' + rightLooks;
}
throw error(message, explanation);
throw error(message, explanation, { expected: expected, actual: actual });
},

@@ -310,0 +301,0 @@ include: function include(needle, haystack) {

{
"name": "assertive",
"version": "2.3.5",
"version": "2.4.0",
"description": "Assertive is a terse yet expressive assertion library",

@@ -27,7 +27,3 @@ "license": "BSD-3-Clause",

},
"browser": {
"diff": "./lib/diff-stub.js"
},
"dependencies": {
"diff": "^3.3.0",
"lodash": "^4.6.1"

@@ -34,0 +30,0 @@ },

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