From 65e65e21c95342c2b3facffa334178c32e5b5d78 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Fri, 11 Dec 2015 10:04:02 -0800 Subject: [PATCH] fix(test): make explicit unsubscription for observable --- spec/subjects/replay-subject-spec.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/subjects/replay-subject-spec.js b/spec/subjects/replay-subject-spec.js index f720a8156a..91556306a0 100644 --- a/spec/subjects/replay-subject-spec.js +++ b/spec/subjects/replay-subject-spec.js @@ -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; @@ -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) { @@ -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 () {