Skip to content

Commit 0881b25

Browse files
author
Sebastian Roming
committed
tests
1 parent f2f9f09 commit 0881b25

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# json-multilevel-delta [![Build Status](https://travis-ci.org/sebastianroming/json-multilevel-delta.svg?branch=master)](https://travis-ci.org/sebastianroming/json-multilevel-delta)
22

3-
> Compare two objects and return the difference (keys)
3+
> Compare two objects and return the difference
44
55
## Install
66
```

test.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import test from 'ava';
2+
import m from '.';
23

3-
test('test', t => {
4-
t.is('x', 'x');
4+
const objectA = { 'a': 'b', 'c': 'd' };
5+
const objectB = { 'c': 'd' };
6+
7+
test('detect the delta length', t => {
8+
t.is(m(objectA, objectB).length, 1);
9+
});
10+
11+
test('detect the correct delta object', t => {
12+
t.deepEqual(m.json(objectA, objectB), { 'a': 'b' });
513
});

0 commit comments

Comments
 (0)