Skip to content
Myr

Additional 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 0118993 · Browse files · 1 file+27 added−11 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+27 added−11 removed

  • tests:+27 added−11 removed

1 file+27 added−11 removed

modified:__tests__/base.js+27 added-11 removed
504 unmodified lines
505 room: {elephant: {kiddo: {age: 10, legs: 5}}}506 })507 })508509 it("should not throw error", () => {509 it("should not throw error #78", () => {510 const base = {511 arr: [512 {513 id: "100",
12 unmodified lines
526 draft.arr.splice(0, 1, newArr)527 draft.arr[0].arr[1].no = 3528 })529 expect(result).toEqual({530 arr: [530 arr: [{531 id: "101",532 arr: [533 {534 id: "100",535 arr: [{id: "1", no: 1}, {id: "2", no: 2}]536 },537 {id: "3", no: 3}538 ]539 }]531 {532 id: "101",533 arr: [534 {535 id: "100",536 arr: [{id: "1", no: 1}, {id: "2", no: 2}]537 },538 {id: "3", no: 3}539 ]540 }541 ]542 })543 })544545 it("should not throw error #78 - 2", () => {546 const base = {547 arr: [{count: 1}, {count: 2}]548 }549 const result = produce(base, draft => {550 debugger551 draft.arr = [draft.arr[1]]552 draft.arr[0].count = 1553 })554 expect(result).toEqual({555 arr: [{count: 1}]556 })557 })558559 it("should handle dates correctly", () => {560 const data = {date: new Date()}561 const next = produce(data, draft => {562 draft.x = true
176 unmodified lines