Skip to content
Myr

Improved test coverage

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 93372fc · Browse files · 2 files+33 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

2 files+33 added−0 removed

  • tests:+33 added−0 removed

2 files+33 added−0 removed

modified:__tests__/base.js+29 added
630 unmodified lines
631 expect(next.bear).toBe(next.cow)632 expect(next.kiddo).toBe(next.cow)633 })634635 if (useProxies)636 it("should not allow changing prototype", () => {637 produce({}, draft => {638 expect(() => Object.setPrototypeOf(draft, Array)).toThrow(639 /try this/640 )641 })642 })643644 it("in should work", () => {645 produce(createBaseState(), draft => {646 expect("anArray" in draft).toBe(true)647 expect(Reflect.has(draft, "anArray")).toBe(true)648649 expect("bla" in draft).toBe(false)650 expect(Reflect.has(draft, "bla")).toBe(false)651652 expect(0 in draft.anArray).toBe(true)653 expect("0" in draft.anArray).toBe(true)654 expect(Reflect.has(draft.anArray, 0)).toBe(true)655 expect(Reflect.has(draft.anArray, "0")).toBe(true)656657 expect(17 in draft.anArray).toBe(false)658 expect("17" in draft.anArray).toBe(false)659 expect(Reflect.has(draft.anArray, 17)).toBe(false)660 expect(Reflect.has(draft.anArray, "17")).toBe(false)661 })662 })663664 afterEach(() => {665 expect(baseState).toBe(origBaseState)666 expect(baseState).toEqual(createBaseState())667 })
21 unmodified lines
modified:__tests__/curry.js+4 added