Skip to content

Commit 5e4aeff

Browse files
committed
chore(RxJs): Fix code that could throw deprecation with RxJs v7
1 parent d6aba74 commit 5e4aeff

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/test/services/pending-requests-interceptor.service.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ describe('PendingRequestsInterceptor', () => {
5858
it('should correctly notify the pendingRequestsStatus observable', waitForAsync(() => {
5959
pendingRequestsInterceptor
6060
.pendingRequestsStatus$
61-
.subscribe(
62-
(next: boolean) => expect(next).toBeTruthy(),
63-
() => expect(1).toBe(2)
64-
);
61+
.subscribe({
62+
next: (next: boolean) => expect(next).toBeTruthy(),
63+
error: () => expect(1).toBe(2)
64+
});
6565

6666
http.get('/fake').subscribe();
6767
httpMock.expectOne('/fake');
@@ -73,19 +73,19 @@ describe('PendingRequestsInterceptor', () => {
7373

7474
pendingRequestsInterceptor
7575
.pendingRequestsStatus$
76-
.subscribe(
77-
(next: boolean) => expect(next).toBeTruthy(),
78-
() => expect(1).toBe(2)
79-
);
76+
.subscribe({
77+
next: (next: boolean) => expect(next).toBeTruthy(),
78+
error: () => expect(1).toBe(2)
79+
});
8080
}));
8181

8282
it('should fail correctly', () => {
8383
const statusTextNotFound = 'NOT FOUND';
8484

85-
http.get('/fake').subscribe(
86-
() => expect(true).toBe(false),
87-
(error: HttpErrorResponse) => expect(error.statusText).toBe(statusTextNotFound)
88-
);
85+
http.get('/fake').subscribe({
86+
next: () => expect(true).toBe(false),
87+
error: (error: HttpErrorResponse) => expect(error.statusText).toBe(statusTextNotFound)
88+
});
8989

9090
const testRequest = httpMock.expectOne('/fake');
9191
testRequest.flush({}, {

src/test/services/spinner-visibility.service.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ describe('SpinnerVisibilityService', () => {
2929
it('should pipe \'true\' when calling show()', () => {
3030
spinnerVisibilityService.show();
3131
spinnerVisibilityService.visibility$
32-
.subscribe(
33-
result => expect(result).toBeTruthy(),
34-
() => expect(true).toBeFalsy()
35-
);
32+
.subscribe({
33+
next: result => expect(result).toBeTruthy(),
34+
error: () => expect(true).toBeFalsy()
35+
});
3636
});
3737

3838
it('should pipe \'false\' when calling hide()', () => {
3939
spinnerVisibilityService.hide();
4040
spinnerVisibilityService.visibility$
41-
.subscribe(
42-
result => expect(result).toBeFalsy(),
43-
() => expect(true).toBeFalsy()
44-
);
41+
.subscribe({
42+
next: result => expect(result).toBeFalsy(),
43+
error: () => expect(true).toBeFalsy()
44+
});
4545
});
4646
});

0 commit comments

Comments
 (0)