Skip to content

Commit

Permalink
test coverage for arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Jan 7, 2020
1 parent 67e5fcf commit c975ddd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ tape('include arrays', function (t) {
t.end()
})

tape('set', function (t) {
var o = {}
R.set(o, ['foo', 0], true)
t.deepEqual(o, {foo: [true]})
R.set(o, ['foo', 1], false)
t.deepEqual(o, {foo: [true, false]})
t.ok(Array.isArray(o.foo), 'created an array in the right place')
t.end()
})

tape('clone does not leave an array reference', function (t) {
var a = {foo: [1]}
t.deepEqual(R.clone(a), a)
Expand All @@ -141,9 +151,3 @@ tape('clone does not leave an array reference', function (t) {

t.end()
})






0 comments on commit c975ddd

Please sign in to comment.