File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ import { HttpClientException } from "../" ;
2+
3+ describe ( "HttpClientException" , ( ) => {
4+ it ( "should export HttpClientException as a class" , ( ) => {
5+ expect ( typeof HttpClientException ) . toBe ( "function" ) ;
6+
7+ const error = new HttpClientException ( {
8+ message : `HTTP Exception: ` ,
9+ statusCode : 422 ,
10+ errorCode : undefined ,
11+ responseHeaders : undefined ,
12+ responseBody : "{\"status\": 422, \"message\": \"Test error\"}" ,
13+ } ) ;
14+
15+ expect ( error ) . toBeInstanceOf ( HttpClientException ) ;
16+ expect ( error . statusCode ) . toBe ( 422 ) ;
17+ } ) ;
18+ } ) ;
Original file line number Diff line number Diff line change @@ -24,5 +24,6 @@ export { default as Config } from "./config";
2424export * from "./services/" ;
2525export { hmacValidator } from "./utils" ;
2626export { default as HttpURLConnectionClient } from "./httpClient/httpURLConnectionClient" ;
27+ export { default as HttpClientException } from "./httpClient/httpClientException" ;
2728export * as Types from "./typings" ;
2829
You can’t perform that action at this time.
0 commit comments