title: Testing redux-observable Epic with debounce operator
body: <p>Having the following redux-observable epic:<br>  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export const mouseEventEpic = (action$, store) =&gt;
   action$
    ::filter(action =&gt; action.type === MOUSE_OUT || action.type === MOUSE_OVER)
    ::debounceTime(200)
    ::map(action =&gt; getMappedAction(action, store));
  
  const getMappedAction = (action, store) =&gt; {
   switch (action.type) {
        case MOUSE_OVER:
          return {type: "OVER"};
        case MOUSE_OUT:
          return {type: "OUT"};
   }
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>and the following test</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { expect } from 'chai';
  import configureMockStore from 'redux-mock-store';
  import { createEpicMiddleware } from 'redux-observable';
  import { mouseEventEpic } from '...';
      
  const epicMiddleware = createEpicMiddleware(mouseEventEpic );
  const mockStore = configureMockStore([epicMiddleware]);
  
  describe('Epic...', () =&gt; {
   let store;
  
   beforeEach(() =&gt; {
    store = mockStore({});
   });
  
   it('test...', () =&gt; {    
    store.dispatch({type:'MOUSE_OVER'});    
    expect(store.getActions()).to.deep.equal([]);
   });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>The store.getActions() returns an array with one action - "MOUSE_OVER". Whereas when removing the debounce it returns another (and the expected) action - "OVER".<br>
  I'd like to stub/remove the debounce operator in the test.
  Tried to follow the ideas in <a href="https://blog.hyphe.me/rxjs-testing-in-real-world-applications/" rel="nofollow noreferrer">this link</a> using the sinon stub function with no success.<br>
  Some guideline on how to mock a RxJS operator or specifically the debounce/throttle would be appreciated.<br>
  Using React, Mocha, Chai, Enzyme...</p>
  
  <p>thanks</p>