Skip to content

Commit

Permalink
fix(test): make explicit unsubscription for observable
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Dec 11, 2015
1 parent bcb01d1 commit 65e65e2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions spec/subjects/replay-subject-spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals describe, it, expect */
/* globals describe, it, expect, expectObservable, hot, rxTestScheduler */
var Rx = require('../../dist/cjs/Rx');

var ReplaySubject = Rx.ReplaySubject;
Expand All @@ -22,9 +22,11 @@ describe('ReplaySubject', function () {
subject.subscribe(function (x) {
expect(x).toBe(expects[i++]);
if (i === 3) {
done();
subject.complete();
}
});
}, function (e) {
done.fail('should not be called');
}, done);
});

it('should replay values and complete', function (done) {
Expand Down Expand Up @@ -66,9 +68,11 @@ describe('ReplaySubject', function () {
subject.subscribe(function (x) {
expect(x).toBe(expects[i++]);
if (i === 2) {
done();
subject.complete();
}
});
}, function (e) {
done.fail('should not be called');
}, done);
});

describe('with bufferSize=2', function () {
Expand Down

0 comments on commit 65e65e2

Please sign in to comment.