var merge = require('../')
var test = require('tap').test

test('throw error if first argument is not an array', function(t) {
  t.throws(merge.all.bind(null, { example: true }, { another: '2' }), TypeError)
})

test('throw error if first argument is an array with least than two elements', function(t) {
  t.throws(merge.all.bind(null, [{ example: true }]), TypeError)
})

test('execute correctly if options object were not passed', function(t) {
  var arrayToMerge = [{ example: true }, { another: '123' }]
  t.doesNotThrow(merge.all.bind(null, arrayToMerge))
})

test('execute correctly if options object were passed', function(t) {
  var arrayToMerge = [{ example: true }, { another: '123' }]
  t.doesNotThrow(merge.all.bind(null, arrayToMerge, { clone:true }))
})

@@ -190,27 +190,23 @@
 '2' %7D), 
-Type
 Error)%0A
+
 %7D)%0A%0Atest
@@ -352,12 +352,8 @@
 %5D), 
-Type
 Erro
@@ -674,32 +674,32 @@
 other: '123' %7D%5D%0A
-
   t.doesNotThrow
@@ -750,12 +750,991 @@
 true %7D))%0A%7D)%0A
+%0Atest('invoke merge on every item in array should result with all props', function(t) %7B%0A  var firstObject = %7B first: true %7D%0A  var secondObject = %7B second: false %7D%0A  var thirdObject = %7B third: 123 %7D%0A  var fourthObject = %7B fourth: 'some string' %7D%0A%0A  var mergedObject = merge.all(%5BfirstObject, secondObject, thirdObject, fourthObject%5D)%0A%0A  t.ok(mergedObject.first === true)%0A  t.ok(mergedObject.second === false)%0A  t.ok(mergedObject.third === 123)%0A  t.ok(mergedObject.fourth === 'some string')%0A%7D)%0A%0Atest('invoke merge on every item in array with clone should change object references', function(t) %7B%0A  var firstObject = %7B link: %7B example: 123 %7D %7D%0A  var secondObject = %7B link: %7B example: true %7D %7D%0A  var thirdObject = %7B link: %7B example: 'string' %7D %7D%0A%0A  var mergedObject = merge.all(%5BfirstObject, secondObject, thirdObject%5D, %7B clone: true %7D)%0A%0A  t.ok(mergedObject.link !== firstObject.link)%0A  t.ok(mergedObject.link !== secondObject.link)%0A  t.ok(mergedObject.link !== thirdObject.link)%0A%7D)%0A

add tests for checking functionality of merge.all