Skip to content
Myr

Add test verifying #613

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

authored by Michel Weststrate · committed by Michel Weststrate · parent 7682990 · Browse files · 2 files+13 added−2 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+13 added−2 removed

  • tests:+13 added−0 removed
  • other:+0 added−2 removed

2 files+13 added−2 removed

modified:__tests__/base.js+13 added
2103 unmodified lines
2104 expect(base.map.get("set2")).toBe(set2)2105 expect(patches.length).toBe(0)2106 })2107 })21082109 if (!autoFreeze) {2110 describe("#613", () => {2111 const x1 = {}2112 const y1 = produce(x1, draft => {2113 draft.foo = produce({bar: "baz"}, draft1 => {2114 draft1.bar = "baa"2115 })2116 draft.foo.bar = "a"2117 })2118 expect(y1.foo.bar).toBe("a")2119 })2120 }2121}21222123function testObjectTypes(produce) {2124 class Foo {
295 unmodified lines
modified:src/core/proxy.ts-2 removed
118 unmodified lines
119 state.scope_.immer_,120 value,121 state122 ))123 // Store drafts on the copy (when one exists).124 // @ts-ignore123 }124 return value125 },126 has(state, prop) {
111 unmodified lines