Skip to content

Commit 48d948f

Browse files
authored
Merge pull request #1526 from Adyen/export-httpclientexception
Export HttpClientException
2 parents 9d8767e + 9bd105c commit 48d948f

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"test:watch": "jest --watch",
3232
"test:coverage": "jest --coverage"
3333
},
34-
"author": "Ricardo Ambrogi",
34+
"author": "Adyen",
3535
"license": "MIT",
3636
"devDependencies": {
3737
"@types/jest": "27.5.2",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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: "Test error",
9+
statusCode: 422,
10+
responseBody: JSON.stringify({ status: 422, message: "Test error" }),
11+
});
12+
13+
expect(error).toBeInstanceOf(HttpClientException);
14+
expect(error.statusCode).toBe(422);
15+
});
16+
});

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ export { default as Config } from "./config";
2424
export * from "./services/";
2525
export { hmacValidator } from "./utils";
2626
export { default as HttpURLConnectionClient } from "./httpClient/httpURLConnectionClient";
27+
export { default as HttpClientException } from "./httpClient/httpClientException";
2728
export * as Types from "./typings";
2829

0 commit comments

Comments
 (0)