Skip to content
Myr

Better property descriptor test

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 e1dd6bc · Browse files · 1 file+14 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

1 file+14 added−1 removed

  • tests:+14 added−1 removed

1 file+14 added−1 removed

modified:__tests__/base.js+14 added-1 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("should support sorting arrays - 2", () => {147 it("should expose property descriptors", () => {148 const nextState = immer([], s => {149 expect(Object.getOwnPropertyDescriptor(s, 0)).toBe(undefined)150 s.unshift("x")151 expect(Object.getOwnPropertyDescriptor(s, 0)).toEqual({152 configurable: true,153 enumerable: true,154 value: "x",155 writable: true156 })157 expect(s.length).toBe(1)158 expect(s[0] === "x").toBe(true)159 })160 expect(nextState).toEqual(["x"])161 expect(Object.getOwnPropertyDescriptor(nextState, 0)).toEqual({162 configurable: !freeze,163 enumerable: true,164 value: "x",165 writable: !freeze166 })167 })168169 it("should support sorting arrays - 2", () => {170 const nextState = immer(baseState, s => {
162 unmodified lines