Skip to content

Commit

Permalink
Remove more deprecated subscribes in tests (#6758)
Browse files Browse the repository at this point in the history
* chore: remove deprecated subscribe in min tests.

* chore: Remove deprecated subscribe calls in Subject.create tests.
  • Loading branch information
benlesh committed Apr 17, 2022
1 parent 6252d6b commit a1ef8f8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 45 deletions.
22 changes: 10 additions & 12 deletions spec/Subject-spec.ts
Expand Up @@ -442,17 +442,16 @@ describe('Subject', () => {
},
};

const sub = Subject.create(destination, source);
const sub: Subject<any> = 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');
Expand Down Expand Up @@ -492,17 +491,16 @@ describe('Subject', () => {
},
};

const sub = Subject.create(destination, source);
const sub: Subject<any> = 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');
Expand Down
66 changes: 33 additions & 33 deletions spec/operators/min-spec.ts
Expand Up @@ -90,45 +90,45 @@ describe('min', () => {
});

it('should min a range() source observable', (done) => {
(<any>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) => {
(<any>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) => {
(<any>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', () => {
Expand Down

0 comments on commit a1ef8f8

Please sign in to comment.