UNPKG

1.18 kBMarkdownView Raw
1# JsDiff with console output
2> Compares JS hashes using JsDiff and outputs the result on the console
3
4[![CircleCI](https://circleci.com/gh/kevgo/jsdiff-console.svg?style=shield)](https://circleci.com/gh/kevgo/jsdiff-console)
5[![Dependency Status](https://david-dm.org/kevgo/jsdiff-console.svg)](https://david-dm.org/kevgo/jsdiff-console)
6[![devDependency Status](https://david-dm.org/kevgo/jsdiff-console/dev-status.svg)](https://david-dm.org/kevgo/jsdiff-console#info=devDependencies)
7
8This is a very simple helper method for tests that require
9diffing JSON data.
10It uses the excellent [jsdiff](https://github.com/kpdecker/jsdiff) module.
11Using it in your tests is super easy:
12
13```javascript
14diffjsConsole(actual-json, expected-json, done);
15```
16
17The third argument is the asynchronous return method for your tests.
18JsDiff-Console will call it with the error message,
19formatted with console colors.
20Your test runner must print it to the user.
21
22
23## Development
24
25* __run tests:__ `spec` (you need to have `watch` running for this)
26* __update dependencies:__ `update`
27* __deploy a new version:__ `publish <patch|minor|major>` (deployment happens via CI and might take a few minutes)