Skip to content

Commit

Permalink
Merge pull request reduxjs#327 from haohcraft/test-functionFieldCase
Browse files Browse the repository at this point in the history
added test case for the function field
  • Loading branch information
gaearon committed Apr 2, 2016
2 parents 93cdfae + d33914b commit 23be1e0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/utils/shallowEqual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ describe('Utils', () => {
{ a: 1, b: 2, c: o }
)
).toBe(true)

const d = function () {return 1}
expect(
shallowEqual(
{ a: 1, b: 2, c: o, d },
{ a: 1, b: 2, c: o, d }
)
).toBe(true)
})

it('should return false if arguments fields are different function identities', () => {
expect(
shallowEqual(
{ a: 1, b: 2, d: function () {return 1} },
{ a: 1, b: 2, d: function () {return 1} }
)
).toBe(false)
})

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

0 comments on commit 23be1e0

Please sign in to comment.