Skip to content
Myr

Added tests

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

authored by Stefan · committed by Stefan · parent 3892e4d · Browse files · 1 file+21 added−0 removed
This commit

State

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

Diff stats

1 file+21 added−0 removed

  • tests:+21 added−0 removed

1 file+21 added−0 removed

modified:__tests__/patch.js+21 added
1145 unmodified lines
1146 `"2020-11-10T08:08:08.003Z"`1147 )1148 expect(rebuilt.date).toEqual(new Date(2020, 10, 10, 8, 8, 8, 3))1149})11501151test("#648 assigning object to itself should not change patches", () => {1152 const input = {1153 obj: {1154 value: 2001155 }1156 }11571158 const [nextState, patches] = produceWithPatches(input, draft => {1159 draft.obj.value = 11160 draft.obj = draft.obj1161 })11621163 expect(patches).toEqual([1164 {1165 op: "replace",1166 path: ["obj", "value"],1167 value: 11168 }1169 ])1170})