 DebouncedCall = require('../../src/DebouncedCall').default
 
 describe 'Unit. DebouncedCall.', ->
+  beforeEach () ->
+    this.debounced = new DebouncedCall(300);
+
   describe 'Simple callback.', ->
     beforeEach () ->
-      this.debounced = new DebouncedCall(300);
       this.simpleValue = undefined;
       this.simpleHandler = (value) =>
         this.simpleValue = value;


  describe 'Collisions with promise pending.', ->
    beforeEach () ->
      this.debounced = new DebouncedCall(300);
      this.promisedHandler = () =>
        return new Promise (resolve, reject) =>
          this.firstPromiseResolve = resolve


  describe 'Promises.', ->
    beforeEach () ->
      this.promisedHandler = undefined;
      this.firstPromiseResolve = undefined;
      this.firstPromiseReject = undefined;
