it('should returns new function with piped all passed functions', () => {
      var spy1 = jasmine.createSpyObj('spy', ['test1', 'test2', 'test3', 'test4']);

      spy1.test1.and.callFake((a) => a + 1);
      spy1.test2.and.callFake((a) => a + 1);
      spy1.test3.and.callFake((a) => a + 1);
      spy1.test4.and.callFake((a) => a + 1);

      var piped = pipe(spy1.test1, spy1.test2, spy1.test3, spy1.test4);

      var result = piped(1, 2, 'foo');

      expect(spy1.test1).toHaveBeenCalledWith(1, 2, 'foo');
      expect(spy1.test2).toHaveBeenCalledWith(2);
      expect(spy1.test3).toHaveBeenCalledWith(3);
      expect(spy1.test4).toHaveBeenCalledWith(4);
      expect(result).toBe(5);
    });
    it('should returns new function with piped all passed functions', () => {
      const spyObject = {
        test1: a => a + 1,
        test2: a => a + 1,
        test3: a => a + 1,
        test4: a => a + 1,
      };
      const spyTest1 = jest.spyOn(spyObject, 'test1');
      const spyTest2 = jest.spyOn(spyObject, 'test2');
      const spyTest3 = jest.spyOn(spyObject, 'test3');
      const spyTest4 = jest.spyOn(spyObject, 'test4');

      const piped = pipe(spyTest1, spyTest2, spyTest3, spyTest4);

      const result = piped(1, 2, 'foo');

      expect(spyTest1).toHaveBeenCalledWith(1, 2, 'foo');
      expect(spyTest2).toHaveBeenCalledWith(2);
      expect(spyTest3).toHaveBeenCalledWith(3);
      expect(spyTest4).toHaveBeenCalledWith(4);
      expect(result).toBe(5);
    });