Skip to content
Myr

Fixed issue where changes were not properly reflected, fixes #32

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 1fa3715 · Browse files · 2 files+6 added−9 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+6 added−9 removed

  • tests:+2 added−9 removed
  • other:+4 added−0 removed

2 files+6 added−9 removed

modified:__tests__/base.js+2 added-9 removed
142 unmodified lines
143 expect(nextState.anArray).not.toBe(baseState.anArray)144 expect(enumerableOnly(nextState.anArray)).toEqual([1, 2, 3, {c: 5}])145 })146147 it.skip("should support sorting arrays - 2", () => {147 it("should support sorting arrays - 2", () => {148 const nextState = immer([], s => {149 debugger149 s.unshift("x")151 // console.dir(s)152 // console.dir(Object.getOwnPropertyDescriptor(s, "length"))153 // console.dir(Object.getOwnPropertyDescriptor(s, 0))150 expect(s.length).toBe(1)151 expect(s[0] === "x").toBe(true)152 })153 expect(nextState).toEqual(["x"])154 })155160 it.skip("should support sorting arrays - 2", () => {156 it("should support sorting arrays - 2", () => {157 const nextState = immer(baseState, s => {162 debugger158 s.anArray.unshift("x")159 s.anArray[3].c = 4165 // console.dir(s.anArray)160 s.anArray.sort()167 // console.dir(s.anArray)161 s.anArray[3].c = 5162 s.anArray.unshift("y")163 })164 expect(nextState).not.toBe(baseState)
155 unmodified lines
modified:changelog.md+4 added