
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@59naga/assert-diff
Advanced tools
Drop-in replacement for assert to give colored diff on command-line with deepEqual.
This exists to give better diff on error when comparing objects or arrays with Mocha.
Should work on *nix shells.
Also has more asserts from https://npmjs.org/package/assert-plus
var assert = require('assert-diff')
it('diff deep equal with message', function() {
assert.deepEqual({pow: "boom", same: true, foo: 2}, {same: true, bar: 2, pow: "bang"}, "this should fail")
})
Should give you:
By default everything works as with Node's deepEqual. Using strict mode is probably what you want. At least is for me. The following example will pass with Node's deepEqual but will fail using strict mode:
var assert = require('assert-diff')
assert.options.strict = true
it('strict diff deep equal', function() {
assert.deepEqual({a: 1, b: 2}, {a: true, b: "2"}, "this should fail")
})
Should give you:
Apache 2.0
FAQs
Drop-in replacement for assert to give diff on deepEqual.
We found that @59naga/assert-diff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.