Skip to content

Commit

Permalink
Add tests for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattphillips committed Nov 30, 2016
1 parent f40bb38 commit a4ecca6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('.diff', () => {
['undefined', undefined],
['object', { a: 1 }],
['array', [1]],
['function', () => ({})],
]).it('returns empty object when given values of type %s are equal', (type, value) => {
expect(diff(value, value)).to.deep.equal({});
});
Expand All @@ -30,7 +31,9 @@ describe('.diff', () => {
[null, undefined],
[undefined, null],
[null, { a: 1 }],
['872983', { areaCode: '+44', number: '872983' }]
['872983', { areaCode: '+44', number: '872983' }],
[100, () => ({})],
[() => ({}), 100],
]).it('returns right hand side value when different to left hand side value (%s, %s)', (lhs, rhs) => {
expect(diff(lhs, rhs)).to.deep.equal(rhs);
});
Expand Down

0 comments on commit a4ecca6

Please sign in to comment.