How to use the rxjs-marbles/tape.cases function in rxjs-marbles

To help you get started, we’ve selected a few rxjs-marbles examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cartant / rxjs-marbles / examples / tape / cases-spec.ts View on Github external
/*tslint:disable:object-literal-sort-keys*/

import { cases, marbles } from "rxjs-marbles/tape";
import { map } from "rxjs/operators";

cases(
  "should support cases",
  (m, c, t) => {
    t.plan(1);

    const source = m.hot(c.s);
    const expected = m.cold(c.e);
    const destination = source.pipe(
      map(value => String.fromCharCode(value.charCodeAt(0) + 1))
    );

    m.expect(destination).toBeObservable(expected);
  },
  {
    empty: {
      s: "-|",
      e: "-|"