Skip to content

Commit 4315cb1

Browse files
committed
Add test for null handling
1 parent 4bc904c commit 4315cb1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/serializableStateInvariantMiddleware.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@ describe('findNonSerializableValue', () => {
6060

6161
expect(result).toEqual({ keyPath: '<root>', value })
6262
})
63+
64+
it('Should accept null as a valid value', () => {
65+
const map = new Map()
66+
const symbol = Symbol.for('testSymbol')
67+
68+
function testFunction() {}
69+
70+
const obj = {
71+
a: 42,
72+
b: {
73+
b1: 1
74+
},
75+
c: null
76+
}
77+
78+
const result = findNonSerializableValue(obj)
79+
80+
expect(result).toEqual(false)
81+
})
6382
})
6483

6584
describe('serializableStateInvariantMiddleware', () => {

0 commit comments

Comments
 (0)