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