Let's write one more test. This time we will be testing the filter() operator. This one is interesting, as it filters away values that does not fulfill a certain condition. Our test file should now look like the following:
import { cold } from "jasmine-marbles";import "rxjs/add/operator/map";import "rxjs/add/operator/filter";describe("marble testing", () => { it("map - should increase by 1", () => { const one$ = cold("x-x|", { x: 1 }); expect(one$.map(x => x + 1)).toBeObservable(cold("x-x|", { x: 2 })); }); it("filter - should remove values", () => { const stream$ = cold("x-y|", { x: 1, y: 2 }); expect(stream$.filter(x => x > 1)).toBeObservable(cold("--y|", { y: 2 })); });});
This test is set up in pretty much ...