Skip to content

Commit 9bd105c

Browse files
committed
Improve test code
1 parent 29beee2 commit 9bd105c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/__tests__/httpClientException.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { HttpClientException } from "../";
1+
import { HttpClientException } from "../";
22

33
describe("HttpClientException", () => {
44
it("should export HttpClientException as a class", () => {
55
expect(typeof HttpClientException).toBe("function");
66

77
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-
});
8+
message: "Test error",
9+
statusCode: 422,
10+
responseBody: JSON.stringify({ status: 422, message: "Test error" }),
11+
});
1412

1513
expect(error).toBeInstanceOf(HttpClientException);
1614
expect(error.statusCode).toBe(422);

0 commit comments

Comments
 (0)