title: RxJS testing catch operator using Jasmine Marbles always fails
body: <p>I'd like to test that if an observable catches a thrown error from inside one of its operators, I get the expected resulting observable.</p>
  
  <p>The service below returns an observable that throws an error or not depending on its error param.</p>
  
  <pre><code>import { Observable } from 'rxjs/Observable';
  import 'rxjs/add/operator/catch';
  import 'rxjs/add/operator/map';
  import 'rxjs/add/operator/merge';
  import 'rxjs/add/operator/do';
  import 'rxjs/add/observable/of';
  
  export function service(obs1: Observable&lt;number&gt;, obs2: Observable&lt;number&gt;, error: boolean = false) {
    return obs1.merge(obs2)
      .map((elt) =&gt; elt * 2)
      .do(() =&gt; {
        if (error) {
          throw new Error();
        }
      })
      .catch(() =&gt; Observable.of(0));
  }
  </code></pre>
  
  <p>With this Jasmine Test</p>
  
  <pre><code>import { cold } from 'jasmine-marbles';
  import { Observable } from 'rxjs/Observable';
  import { service } from './catch';
  
  describe('Test Marbles', () =&gt; {
    it('should work', () =&gt; {
      const e1 = cold('-a-|', {a: 1});
      const e2 = cold('--b-|', {b: 2});
      const expected = cold('-ab-|', {a: 2, b: 4});
      const obs: Observable&lt;number&gt; = service(e1, e2);
      expect(obs).toBeObservable(expected);
    });
  
    it('should handle error', () =&gt; {
      const e1 = cold('-a-|', {a: 1});
      const e2 = cold('--b-|', {b: 2});
      const expected = cold('-c', {c: 0});
      const obs: Observable&lt;number&gt; = service(e1, e2, true);
      expect(obs).toBeObservable(expected);
    });
  });
  </code></pre>
  
  <p>I get the output below for the second test that fails.</p>
  
  <pre><code>Expected [ Object({ frame: 10, notification: Notification({ kind: 'N', value: 0, error: undefined, hasValue: true }) }), Object({ frame: 10, notification: Notification({ kind: 'C', value: undefined, error: undefined, hasValue: false }) }) ] to equal [ Object({ frame: 10, notification: Notification({ kind: 'N', value: 0, error: undefined, hasValue: true }) }) ].
  </code></pre>