title: rxjs jest Mocking object in stream
body: <p>Hi I try to test this code</p>
  
  <pre><code>import { Observable, Subscriber } from 'rxjs';
  function getJavaRequest&lt;T&gt;(globals: any): (name: string) =&gt; Observable&lt;T&gt; {
  return (name: string) =&gt; Observable
      .create((observer: Subscriber&lt;T&gt;) =&gt; {
          globals[name] = (event: T) =&gt; observer.next(event);
      });
      };
  </code></pre>
  
  <p>I am using jest framework. And I want to create mock object in jest and  check that function create stream and add someting to stream 
  And I have something like this</p>
  
  <pre><code>import {getJavaRequest } from './JcefStreams';
  import { TestScheduler } from 'rxjs/testing';
  test('It should return mocked object from stream', () =&gt; {
  const testObject = jest.mock();
  let test;
  getJavaRequest(testObject).subscribe(e: any =&gt; e == test);
  
  expect(test).toBe(global);
  });
  </code></pre>
  
  <p>But it not working correctly</p>