'use strict';

var jf = require('../../'),
    expect    = require('chai').expect,
    fs = require('fs');

const testFilePath = './' + Math.random() + '.json';
const testFile2Path = './' + Math.random() + '.json';

const collectedFilePath = './' + Math.random() + '.json';

const objToAdd = { msg: 'added by collect executer' };

describe('Collect function', function () {
  it('should work without error', function (done) {

    jf.filed( [ testFilePath, testFile2Path ] ).io(
      function( obj, filePath) {
        return { file: filePath };
      }
    )
    .collect(
      function(obj){
        obj[2] = objToAdd;
        return obj;
      },
      collectedFilePath,
      function(err){ console.log(err); }
    )
    .pass(( obj ) => {

      expect( obj.length ).to.be.equal(3);

      expect(
        obj[0].file == testFilePath ||
        obj[0].file == testFile2Path ).to.be.equal( true );
      expect(
        obj[1].file == testFilePath ||
        obj[1].file == testFile2Path ).to.be.equal( true );

      expect( obj[0].file != obj[1].file ).to.be.equal(true);

      expect( obj[2] ).to.be.eql( objToAdd );

      done() } )
    .exec();
  });
});

@@ -199,32 +199,86 @@
 dom() + '.json';
+%0Aconst testFile3Path = './' + Math.random() + '.json';
 %0A%0Aconst collecte
@@ -617,37 +617,130 @@
    .
-collect(%0A      function(obj)%7B
+filter( obj =%3E obj.file != testFile3Path )%0A    .collect(%0A      function(obj)%7B%0A        expect( obj.length ).to.be.equal(2);
 %0A   

Add logic of filter to testCollect.js