const Code = require('code');
const Lab = require('lab');
const lab = exports.lab = Lab.script();

const describe = lab.describe;
const experiment = lab.experiment;
const test = lab.test;
const it = lab.it;
const before = lab.before;
const after = lab.after;

const expect = Code.expect;

const _ = require('../src/index');

const options = { parallel: true }

experiment('# Reject over collection ', options, () => {
    test('should return resutls correctly with promise', options, () => {
      let collection = { a:1, b:2, c:3, d:'string' }
      let iterator = (value, index, collection) =>  Number.isInteger(value)

      return _.reject(collection, iterator)
        .then((result) => {
          expect(result).to.equal(['string']);
        })
    });

    test('should return results correctly with callbacks', options, () => {
      let collection = { a:1, b:2, c:3, d:'string' }
      let iterator = (value, index, collection) => Number.isInteger(value)
      let cb = (result, err) => {
        expect(result).to.equal(['string']);
      }

      return _.reject(collection, iterator, cb)
    });
  })

@@ -379,23 +379,8 @@
 ect 
-over collection
  ', 
@@ -396,18 +396,16 @@
 () =%3E %7B%0A
-  
   test('
@@ -422,18 +422,18 @@
 urn resu
-t
 l
+t
 s correc
@@ -432,24 +432,40 @@
 s correctly 
+over collection 
 with promise
@@ -476,34 +476,32 @@
 ptions, () =%3E %7B%0A
-  
     let collecti
@@ -531,34 +531,32 @@
 :'string' %7D%0A    
- 
- 
 let iterator = (
@@ -610,26 +610,24 @@
 value)%0A%0A    
-  
 return _.rej
@@ -652,18 +652,16 @@
 erator)%0A
-  
       .t
@@ -682,26 +682,24 @@
 %3E %7B%0A        
-  
 expect(resul
@@ -733,24 +733,18 @@
     
-  
 %7D)%0A
-  
   %7D);%0A%0A
-  
   te
@@ -779,16 +779,32 @@
 rrectly 
+over collection 
 with cal
@@ -825,26 +825,24 @@
 ns, () =%3E %7B%0A
-  
     let coll
@@ -880,18 +880,16 @@
 ring' %7D%0A
-  
     let 
@@ -957,18 +957,16 @@
 ue)%0A    
-  
 let cb =
@@ -981,26 +981,24 @@
 , err) =%3E %7B%0A
-  
       expect
@@ -1036,70 +1036,676 @@
     
+%7D%0A%0A    return _.reject(collection, iterator, cb)%0A
   %7D
+);
 %0A%0A  
-    return _.reject(collec
+test('should return results correctly over array with promise', options, () =%3E %7B%0A    let arr = %5B1,2,3,'string'%5D%0A    let iterator = (value, index, arr) =%3E  Number.isInteger(value)%0A%0A    return _.reject(arr, iterator)%0A      .then((result) =%3E %7B%0A        expect(result).to.equal(%5B'string'%5D);%0A      %7D)%0A  %7D);%0A%0A  test('should return results correctly over array with callbacks', op
 tion
+s
 , 
-iterator, cb)%0A    %7D);%0A  
+() =%3E %7B%0A    let arr = %5B1,2,3,'string'%5D%0A    let iterator = (value, index, arr) =%3E Number.isInteger(value)%0A    let cb = (result, err) =%3E %7B%0A      expect(result).to.equal(%5B'string'%5D);%0A    %7D%0A%0A    return _.reject(arr, iterator, cb)%0A  %7D);%0A
 %7D)%0A

add unit tests for reject() with array as inputs