Skip to content
Myr

Merge pull request #13 from benbraou/issue12

Before adoption: this commit came in with the history the project adopted, so no landing records it.

make isProxy method check if value parameter is defined

authored by Michel Weststrate · committed by GitHub · parents ae0182f, 60067f3 · Browse files · 2 files+10 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−1 removed

  • tests:+9 added−0 removed
  • other:+1 added−1 removed

2 files+10 added−1 removed

modified:__tests__/base.js+9 added
168 unmodified lines
169 })170 expect(nextState.messy.nested).toBe(baseState.anObject.nested)171 })172173 it("should allow setting to undefined a defined draft property", () => {174 const nextState = immer(baseState, s => {175 s.aProp = undefined176 })177 expect(nextState).not.toBe(baseState)178 expect(baseState.aProp).toBe('hi')179 expect(nextState.aProp).toBe(undefined)180 })181182 afterEach(() => {183 expect(baseState).toBe(origBaseState)184 expect(baseState).toEqual(createBaseState())185 })
48 unmodified lines
modified:immer.js+1 added-1 removed