Skip to content
Myr

add tests for function as base state

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by aleclarson · committed by Alec Larson · parent 9a0f7d1 · Browse files · 2 files+9 added−3 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+9 added−3 removed

  • tests:+9 added−3 removed

2 files+9 added−3 removed

modified:__tests__/base.js+9 added
1273 unmodified lines
1274 )1275 })1276 })12771278 it("allows a function as the base state", () => {1279 let fn = () => {}1280 expect(1281 produce(fn, draft => {1282 expect(fn).toBe(draft)1283 })1284 ).toBe(fn)1285 })12861287 it("cannot return and produce undefined!", () => {1288 const base = 31289 expect(produce(base, () => 4)).toBe(4)1290 expect(produce(base, () => null)).toBe(null)
38 unmodified lines
modified:__tests__/curry.js-3 removed