How to use the rxjs-marbles/mocha.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 / mocha / basic-spec.ts View on Github external
z: 4
      };

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

      const destination = source.pipe(map(value => value + 1));
      m.expect(destination).toBeObservable(expected);
      m.expect(source).toHaveSubscriptions(subs);
    })
  );

  it(
    "should support marble tests with errors",
    marbles(m => {
      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);
    })
  );

  it(
    "should support marble tests with explicit errors",
    marbles(m => {
      const inputs = {
        a: 1,
        b: 2,
github code0wl / typescript-rxjs-webpack / main.spec.ts View on Github external
describe("rxjs-marbles", () => {
  it(
    "should support marble tests",
    marbles(m => {
      const source = m.hot("--^-a-b-c-|");
      const subs = "^-------!";
      const expected = "--b-c-d-|";

      const destination = source.pipe(
        map(value => String.fromCharCode(value.charCodeAt(0) + 1))
      );
      m.expect(destination).toBeObservable(expected);
      m.expect(source).toHaveSubscriptions(subs);
    })
  );
});