diff --git a/spec/Subject-spec.ts b/spec/Subject-spec.ts index f6f68153bd..92919f1682 100644 --- a/spec/Subject-spec.ts +++ b/spec/Subject-spec.ts @@ -442,17 +442,16 @@ describe('Subject', () => { }, }; - const sub = Subject.create(destination, source); + const sub: Subject = Subject.create(destination, source); - sub.subscribe( - function (x: number) { + sub.subscribe({ + next: function (x: number) { output.push(x); }, - null, - () => { + complete: () => { outputComplete = true; } - ); + }); sub.next('a'); sub.next('b'); @@ -492,17 +491,16 @@ describe('Subject', () => { }, }; - const sub = Subject.create(destination, source); + const sub: Subject = Subject.create(destination, source); - sub.subscribe( - function (x: number) { + sub.subscribe({ + next: function (x: number) { output.push(x); }, - null, - () => { + complete: () => { outputComplete = true; } - ); + }); sub.next('a'); sub.next('b'); diff --git a/spec/operators/min-spec.ts b/spec/operators/min-spec.ts index e415da2f47..28c40688c4 100644 --- a/spec/operators/min-spec.ts +++ b/spec/operators/min-spec.ts @@ -90,45 +90,45 @@ describe('min', () => { }); it('should min a range() source observable', (done) => { - (range(1, 10000)).pipe(min()).subscribe( - (value: number) => { - expect(value).to.equal(1); - }, - (x: any) => { - done(new Error('should not be called')); - }, - () => { - done(); - } - ); + range(1, 10000) + .pipe(min()) + .subscribe({ + next: (value) => { + expect(value).to.equal(1); + }, + error: () => { + done(new Error('should not be called')); + }, + complete: done, + }); }); it('should min a range().skip(1) source observable', (done) => { - (range(1, 10)).pipe(skip(1), min()).subscribe( - (value: number) => { - expect(value).to.equal(2); - }, - (x: any) => { - done(new Error('should not be called')); - }, - () => { - done(); - } - ); + range(1, 10) + .pipe(skip(1), min()) + .subscribe({ + next: (value) => { + expect(value).to.equal(2); + }, + error: () => { + done(new Error('should not be called')); + }, + complete: done, + }); }); it('should min a range().take(1) source observable', (done) => { - (range(1, 10)).pipe(take(1), min()).subscribe( - (value: number) => { - expect(value).to.equal(1); - }, - (x: any) => { - done(new Error('should not be called')); - }, - () => { - done(); - } - ); + range(1, 10) + .pipe(take(1), min()) + .subscribe({ + next: (value) => { + expect(value).to.equal(1); + }, + error: () => { + done(new Error('should not be called')); + }, + complete: done, + }); }); it('should work with error', () => {