Comparing version 2.3.5 to 2.4.0
@@ -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 @@ |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
70408
491
- Removeddiff@^3.3.0
- Removeddiff@3.5.0(transitive)