UNPKG

reakit

Version:

Toolkit for building accessible rich web apps with React

22 lines (20 loc) 341 B
import { unstable_setIn } from "../setIn"; test("setIn", () => { const obj = { a: { b: ["c", "d"], e: "f", g: 1, }, }; expect(unstable_setIn(obj, "a", null)).toEqual({ a: null, }); expect(unstable_setIn(obj, ["a", "b"], 0)).toEqual({ ...obj, a: { ...obj.a, b: 0, }, }); });