describe('Service: debounce', function () {

  beforeEach(module('ngNephila.services.debounce'));

  var debounce, $timeout;

  beforeEach(inject(function (_debounce_,  _$timeout_) {
    debounce = _debounce_;
    $timeout = _$timeout_;
  }));

  it('should fucking work', function () {
    expect(debounce).toBeDefined();
  });

  it('shouldnt execute immediately', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 100, false);
    expect(counter).toBe(0);
    incr();
    expect(counter).toBe(0);
  });

  it('should execute after delay', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 200);
    incr();
    expect(counter).toBe(0);
    $timeout.flush(200);
    expect(counter).toBe(1);
  });

  it('should only happen once', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 200);
    incr();
    incr();
    expect(counter).toBe(0);
    $timeout.flush(200);
    expect(counter).toBe(1);
    incr();
    incr();
    $timeout.flush(200);
    expect(counter).toBe(2);
  });

});

@@ -538,32 +538,223 @@
 toBe(0);%0A  %7D);%0A%0A
+  it('should execute immediately', function()%7B%0A    var counter = 0;%0A    var incr = debounce(function()%7B%0A      counter += 1;%0A    %7D, 100, true);%0A    incr();%0A    expect(counter).toBe(1);%0A  %7D);%0A%0A
   it('should exe

Add tests for debounce immediate call