Skip to content

Commit

Permalink
chore(observeOn): fix skipped test
Browse files Browse the repository at this point in the history
Closes #2457 #2459
  • Loading branch information
cartant committed Jul 27, 2018
1 parent 3326781 commit b55dd13
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/operators/observeOn-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('observeOn operator', () => {
expectSubscriptions(e1.subscriptions).toBe(sub);
});

xit('should clean up subscriptions created by async scheduling (prevent memory leaks #2244)', (done) => {
it('should clean up subscriptions created by async scheduling (prevent memory leaks #2244)', (done) => {
//HACK: Deep introspection to make sure we're cleaning up notifications in scheduling.
// as the architecture changes, this test may become brittle.
const results: number[] = [];
Expand All @@ -104,7 +104,7 @@ describe('observeOn operator', () => {
.subscribe(
x => {
const observeOnSubscriber = subscription._subscriptions[0];
expect(observeOnSubscriber._subscriptions.length).to.equal(2); // 1 for the consumer, and one for the notification
expect(observeOnSubscriber._subscriptions.length).to.equal(2); // one for the consumer, and one for the notification
expect(observeOnSubscriber._subscriptions[1].state.notification.kind)
.to.equal('N');
expect(observeOnSubscriber._subscriptions[1].state.notification.value)
Expand All @@ -114,10 +114,11 @@ describe('observeOn operator', () => {
err => done(err),
() => {
// now that the last nexted value is done, there should only be a complete notification scheduled
// the consumer will have been unsubscribed via Subscriber#_parentSubscription
const observeOnSubscriber = subscription._subscriptions[0];
expect(observeOnSubscriber._subscriptions.length).to.equal(2); // 1 for the consumer, one for the complete notification
expect(observeOnSubscriber._subscriptions.length).to.equal(1); // one for the complete notification
// only this completion notification should remain.
expect(observeOnSubscriber._subscriptions[1].state.notification.kind)
expect(observeOnSubscriber._subscriptions[0].state.notification.kind)
.to.equal('C');
// After completion, the entire _subscriptions list is nulled out anyhow, so we can't test much further than this.
expect(results).to.deep.equal([1, 2, 3]);
Expand Down

0 comments on commit b55dd13

Please sign in to comment.