Skip to content

Commit

Permalink
test(ts): pass readonly array to curried producer
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jan 12, 2019
1 parent 89f6443 commit f94fcaa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions __tests__/produce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ it("can provide rest parameters to a curried producer", () => {
bar(undefined, 1, 2)
})

it("can pass readonly arrays to curried producers", () => {
let foo = produce((_: any[]) => {})
foo([] as ReadonlyArray<any>)

// With initial state:
let bar = produce((_: any[]) => {}, [])
bar([] as ReadonlyArray<any>)
})

it("can produce nothing", () => {
let val: undefined = produce({}, s => nothing)
})
Expand Down

0 comments on commit f94fcaa

Please sign in to comment.