Skip to content
Myr

Added a testcase

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 29eae5b · Browse files · 1 file+17 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+17 added−0 removed

  • tests:+17 added−0 removed

1 file+17 added−0 removed

modified:__tests__/base.js+17 added
233 unmodified lines
234 const test = proxy.coffee235 }).toThrowError(/revoked/)236 })237238 it("should reflect all changes made in the draft immediately", () => {239 immer(baseState, draft => {240 draft.anArray[0] = 5241 draft.anArray.unshift("test")242 // sliced here; jest will also compare non-enumerable keys, which would include the immer Symbols243 expect(draft.anArray.slice()).toMatchObject([244 "test",245 5,246 2,247 {c: 3},248 1249 ])250 draft.stuffz = "coffee"251 expect(draft.stuffz).toBe("coffee")252 })253 })254255 afterEach(() => {256 expect(baseState).toBe(origBaseState)257 expect(baseState).toEqual(createBaseState())258 })
15 unmodified lines