Of course been doing tdd, althoguh the tests are not very expressives.
The code lives here.
Some examples of tests
describe("combine filter, map & reduce", function(){ it("return the result of combination of filter, mal and reduce", function(){ var data = [1,2,3,4,5,6]; var resultExpected = 15; var result = reduce( map( filter( data, functionForFilter ), functionForMap ), 0, functionForReduce ); expect(resultExpected).to.eql(result); }); function functionForMap(y){ return y + 1; } function functionForFilter(x){ return x % 2 == 0; } function functionForReduce(acumulative, z){ return acumulative + z; } }); describe("PipeLine object", function(){ it("make pipe line through different functions", function(){ var arrayOfData = [1,2,3]; var expectedResult = 9; var handlerOne = function(data){ return map(data, function(number){ return number +1; }); } var handlerTwo = function(data){ var result = 0; return reduce(data, result, function(result, number){ return result + number; }); } var pipeLine = new PipeLine(); var pipeLineResult = pipeLine.pipe(handlerOne) .pipe(handlerTwo) .execute(arrayOfData); expect(expectedResult).to.eql(pipeLineResult); }); }); describe("curry function", function(){ var expectedResult = 10; var add = function(a, b, c, d){ return a + b + c + d; } var curriedFunction = curry(add); beforeEach(function(){}); it("curry function with all parameters as partial", function(){ var result = curriedFunction(1)(2)(3)(4); expect(expectedResult).to.eql(result); }); it("curry function with two parameters as partial", function(){ var result = curriedFunction(1, 2)(3)(4); expect(expectedResult).to.eql(result); }); it("curry function with one parameters as partial", function(){ var result = curriedFunction(1, 2, 3)(4); expect(expectedResult).to.eql(result); }); it("curry function with parameters as partial in two pairs", function(){ var result = curriedFunction(1, 2)(3, 4); expect(expectedResult).to.eql(result); }); it("curry function with parameters as usual", function(){ var result = curriedFunction(1, 2, 3, 4); expect(expectedResult).to.eql(result); }); });