empty.ts
This file
Path
__tests__/empty.ts
29 lines · 675 bytes · TypeScript
Last changed by
map unification WIPMichel Weststratebefore adoption9bcefb6
History of this fileTake it
map unification WIPMichel Weststratebefore adoption9bcefb6
line 1why, one step back1import {produce, produceWithPatches, setUseProxies} from "../src"Merge branch 'master' into map-fixesMichel Weststratebefore adoptioncb63fb0
lines 2–6why, one step back23test("empty stub test", () => {4 expect(true).toBe(true)5})6map unification WIPMichel Weststratebefore adoption9bcefb6
lines 7–16why, one step back7describe("map set", () => {8 test("can assign set value", () => {9 setUseProxies(false)1011 const baseState = new Map([["x", 1]])12 const nextState = produce(baseState, s => {13 s.set("x", 2)14 })15 expect(nextState).not.toBe(baseState)16 expect(nextState.get("x")).toEqual(2)Merge branch 'master' into map-fixesMichel Weststratebefore adoptioncb63fb0
line 17why, one step back17 })map unification WIPMichel Weststratebefore adoption9bcefb6
lines 18–28why, one step back1819 test("can assign by key", () => {20 setUseProxies(false)2122 const baseState = new Map([["x", {a: 1}]])23 const nextState = produce(baseState, s => {24 s.get("x")!.a++25 })26 expect(nextState).not.toBe(baseState)27 expect(nextState.get("x")!.a).toEqual(2)28 })Merge branch 'master' into map-fixesMichel Weststratebefore adoptioncb63fb0
line 29why, one step back29})