|
1 | 1 | import { HttpPlugin } from "../../index"; |
2 | 2 |
|
3 | 3 | import axios, { AxiosResponse, AxiosRequestConfig } from "axios"; |
| 4 | +import { ResponseType } from "../../types"; |
4 | 5 |
|
5 | 6 | // mock axios |
6 | 7 | jest.mock("axios"); |
@@ -35,7 +36,7 @@ describe("test http plugin", () => { |
35 | 36 | { key: "X-Test-Header", value: "test-header-value" }, |
36 | 37 | ], |
37 | 38 | urlParams: [{ key: "q", value: "test-param" }], |
38 | | - responseType: "TEXT", |
| 39 | + responseType: ResponseType.TEXT, |
39 | 40 | }); |
40 | 41 |
|
41 | 42 | expect(mockedAxios.get).lastCalledWith("/api/test", { |
@@ -72,7 +73,7 @@ describe("test http plugin", () => { |
72 | 73 | { key: "X-Test-Header", value: "test-header-value" }, |
73 | 74 | ], |
74 | 75 | urlParams: [{ key: "q", value: "test-param" }], |
75 | | - responseType: "BINARY", |
| 76 | + responseType: ResponseType.BINARY, |
76 | 77 | }); |
77 | 78 |
|
78 | 79 | expect(mockedAxios.get).lastCalledWith("/api/test", { |
@@ -114,7 +115,7 @@ describe("test http plugin", () => { |
114 | 115 | ], |
115 | 116 | urlParams: [{ key: "q", value: "test-param" }], |
116 | 117 | body: "{request: 1001}", |
117 | | - responseType: "TEXT", |
| 118 | + responseType: ResponseType.TEXT, |
118 | 119 | }); |
119 | 120 |
|
120 | 121 | expect(mockedAxios.post).lastCalledWith("/api/test", "{request: 1001}", { |
@@ -152,7 +153,7 @@ describe("test http plugin", () => { |
152 | 153 | ], |
153 | 154 | urlParams: [{ key: "q", value: "test-param" }], |
154 | 155 | body: "{request: 1001}", |
155 | | - responseType: "BINARY", |
| 156 | + responseType: ResponseType.BINARY, |
156 | 157 | }); |
157 | 158 |
|
158 | 159 | expect(mockedAxios.post).lastCalledWith("/api/test", "{request: 1001}", { |
|
0 commit comments