https://github.com/caub/deep-eq
deep equal assertion, with a pretty diff
https://github.com/caub/deep-eq
Last synced: about 2 months ago
JSON representation
deep equal assertion, with a pretty diff
- Host: GitHub
- URL: https://github.com/caub/deep-eq
- Owner: caub
- Created: 2017-11-17T17:38:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-10T17:07:06.000Z (over 8 years ago)
- Last Synced: 2025-06-26T22:41:28.391Z (about 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# deep-eq
[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![coverage status][codecov-image]][codecov-url]
## Why?
- `assert.deepEqual` [doesn't display well](https://github.com/nodejs/node/issues/15696) the diff between 2 objects
- simple: no transpiling needed
```js
const eq = require('deep-eq');
eq({foo: {ok: 1}}, {foo: {ok: 2, u: 0}});
```
outputs: (colors not shown, key and values (left/right) have different colors)
```sh
AssertionError:
foo.ok 1 foo.ok 2
foo.u 0
at ....stacktrace...
```
[npm-image]: https://img.shields.io/npm/v/deep-eq.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/deep-eq
[travis-image]: https://img.shields.io/travis/caub/deep-eq.svg?style=flat-square
[travis-url]: https://travis-ci.org/caub/deep-eq
[codecov-image]: https://img.shields.io/codecov/c/github/caub/deep-eq.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/caub/deep-eq