Skip to content

Commit d33914b

Browse files
committed
added test case for the function field
1 parent 93cdfae commit d33914b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/utils/shallowEqual.spec.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ describe('Utils', () => {
2525
{ a: 1, b: 2, c: o }
2626
)
2727
).toBe(true)
28+
29+
const d = function () {return 1}
30+
expect(
31+
shallowEqual(
32+
{ a: 1, b: 2, c: o, d },
33+
{ a: 1, b: 2, c: o, d }
34+
)
35+
).toBe(true)
36+
})
37+
38+
it('should return false if arguments fields are different function identities', () => {
39+
expect(
40+
shallowEqual(
41+
{ a: 1, b: 2, d: function () {return 1} },
42+
{ a: 1, b: 2, d: function () {return 1} }
43+
)
44+
).toBe(false)
2845
})
2946

3047
it('should return false if first argument has too many keys', () => {

0 commit comments

Comments
 (0)