"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var appendFunction_1 = require("./appendFunction"); describe('appendFunction', function () { it('can append 2 functions', function () { var counter = 0; var function1 = function () { return counter++; }; var function2 = function () { return counter++; }; var function3 = (0, appendFunction_1.appendFunction)({}, function1, function2); function3(); expect(counter).toEqual(2); }); it('can deal with falsey values', function () { var counter = 0; var function1 = function () { return counter++; }; var function2 = function () { return counter++; }; var function3 = (0, appendFunction_1.appendFunction)({}, function1, undefined, null, function2); function3(); expect(counter).toEqual(2); }); it('preserves the parent', function () { function add() { this.counter++; } var Foo = /** @class */ (function () { function Foo() { this.counter = 0; this.add = (0, appendFunction_1.appendFunction)(this, add, this.add); } Foo.prototype.add = function () { this.counter++; }; return Foo; }()); var foo = new Foo(); foo.add(); expect(foo.counter).toEqual(2); }); }); //# sourceMappingURL=appendFunction.test.js.map