Skip to content

Commit

Permalink
test(filter): add test against breaking unsubscription chain
Browse files Browse the repository at this point in the history
Relates to #875.
  • Loading branch information
luisgabriel authored and benlesh committed Dec 8, 2015
1 parent 9e702fe commit dedbfc8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/operators/filter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,19 @@ describe('Observable.prototype.filter()', function () {
expect(true).toBe(false);
});
});

it('should not break unsubscription chain when unsubscribed explicitly', function () {
var source = hot('-1--2--^-3-4-5-6--7-8--9--|');
var subs = '^ ! ';
var unsub = ' ! ';
var expected = '--3---5----7- ';

var r = source
.mergeMap(function (x) { return Observable.of(x); })
.filter(isPrime)
.mergeMap(function (x) { return Observable.of(x); });

expectObservable(r, unsub).toBe(expected);
expectSubscriptions(source.subscriptions).toBe(subs);
});
});

0 comments on commit dedbfc8

Please sign in to comment.