Skip to content

Commit 980468d

Browse files
committed
Cleanup inject function
1 parent ad18d40 commit 980468d

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

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

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,25 @@ describe('PendingInterceptorService', () => {
9292
})
9393
));
9494

95-
it('should fail correctly',
96-
inject(
97-
[PendingInterceptorService, HttpClient, HttpTestingController],
98-
(service: PendingInterceptorService, http: HttpClient, httpMock: HttpTestingController) => {
99-
100-
const statusText = 'NOT FOUND';
101-
102-
http.get('/fake').subscribe(
103-
(next: boolean) => expect(true).toBe(false),
104-
(error: HttpErrorResponse) => expect(error.statusText).toBe(statusText)
105-
);
106-
107-
const testRequest = httpMock.expectOne('/fake');
108-
testRequest.flush({}, {
109-
'headers': {
110-
'name': 'useless-header'
111-
},
112-
'status': 404,
113-
'statusText': statusText
114-
});
115-
httpMock.verify();
116-
})
117-
);
95+
it('should fail correctly', inject(
96+
[HttpClient, HttpTestingController], (http: HttpClient, httpMock: HttpTestingController) => {
97+
98+
const statusText = 'NOT FOUND';
99+
100+
http.get('/fake').subscribe(
101+
(next: boolean) => expect(true).toBe(false),
102+
(error: HttpErrorResponse) => expect(error.statusText).toBe(statusText)
103+
);
104+
105+
const testRequest = httpMock.expectOne('/fake');
106+
testRequest.flush({}, {
107+
'headers': {
108+
'name': 'useless-header'
109+
},
110+
'status': 404,
111+
'statusText': statusText
112+
});
113+
httpMock.verify();
114+
}
115+
));
118116
});

0 commit comments

Comments
 (0)