How to use the rxjs-marbles/tape.marbles 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 / basic-spec.ts View on Github external
marbles((m, t) => {
    t.plan(2);

    const source = m.hot("  --^-a-b-c-#");
    const subs = "            ^-------!";
    const expected = m.cold(" --a-b-c-#");

    const destination = source;
    m.expect(destination).toBeObservable(expected);
    m.expect(source).toHaveSubscriptions(subs);
  })
);

test(
  "should support marble tests with explicit errors",
  marbles((m, t) => {
    t.plan(2);

    const inputs = {
      a: 1,
      b: 2,
      c: 3
    };
    const outputs = {
      x: 2,
      y: 3,
      z: 4
    };

    const source = m.hot("  --^-a-b-c-#", inputs, new Error("Boom!"));
    const subs = "            ^-------!";
    const expected = m.cold(" --x-y-z-#", outputs, new Error("Boom!"));