Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a4ecca6

Browse files
Add tests for functions
1 parent f40bb38 commit a4ecca6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/index.spec.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe('.diff', () => {
1515
['undefined', undefined],
1616
['object', { a: 1 }],
1717
['array', [1]],
18+
['function', () => ({})],
1819
]).it('returns empty object when given values of type %s are equal', (type, value) => {
1920
expect(diff(value, value)).to.deep.equal({});
2021
});
@@ -30,7 +31,9 @@ describe('.diff', () => {
3031
[null, undefined],
3132
[undefined, null],
3233
[null, { a: 1 }],
33-
['872983', { areaCode: '+44', number: '872983' }]
34+
['872983', { areaCode: '+44', number: '872983' }],
35+
[100, () => ({})],
36+
[() => ({}), 100],
3437
]).it('returns right hand side value when different to left hand side value (%s, %s)', (lhs, rhs) => {
3538
expect(diff(lhs, rhs)).to.deep.equal(rhs);
3639
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /