Skip to content

Commit ad65060

Browse files
committed
Update all unit tests snapshots
1 parent 6d0ec6d commit ad65060

File tree

24 files changed

+847
-318
lines changed

24 files changed

+847
-318
lines changed

tests/__snapshots__/extended.test.ts.snap

Lines changed: 336 additions & 126 deletions
Large diffs are not rendered by default.

tests/__snapshots__/simple.test.ts.snap

Lines changed: 336 additions & 126 deletions
Large diffs are not rendered by default.

tests/spec/another-query-params/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,12 @@ export class HttpClient<SecurityDataType = unknown> {
138138
[ContentType.Json]: (input: any) =>
139139
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
140140
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
141-
[ContentType.FormData]: (input: any) =>
142-
Object.keys(input || {}).reduce((formData, key) => {
141+
[ContentType.FormData]: (input: any) => {
142+
if (input instanceof FormData) {
143+
return input;
144+
}
145+
146+
return Object.keys(input || {}).reduce((formData, key) => {
143147
const property = input[key];
144148
formData.append(
145149
key,
@@ -150,7 +154,8 @@ export class HttpClient<SecurityDataType = unknown> {
150154
: \`\${property}\`,
151155
);
152156
return formData;
153-
}, new FormData()),
157+
}, new FormData());
158+
},
154159
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
155160
};
156161

tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ export class HttpClient<SecurityDataType = unknown> {
110110
[ContentType.Json]: (input: any) =>
111111
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
112112
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
113-
[ContentType.FormData]: (input: any) =>
114-
Object.keys(input || {}).reduce((formData, key) => {
113+
[ContentType.FormData]: (input: any) => {
114+
if (input instanceof FormData) {
115+
return input;
116+
}
117+
118+
return Object.keys(input || {}).reduce((formData, key) => {
115119
const property = input[key];
116120
formData.append(
117121
key,
@@ -122,7 +126,8 @@ export class HttpClient<SecurityDataType = unknown> {
122126
: \`\${property}\`,
123127
);
124128
return formData;
125-
}, new FormData()),
129+
}, new FormData());
130+
},
126131
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
127132
};
128133

tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ export class HttpClient<SecurityDataType = unknown> {
150150
[ContentType.Json]: (input: any) =>
151151
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
152152
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
153-
[ContentType.FormData]: (input: any) =>
154-
Object.keys(input || {}).reduce((formData, key) => {
153+
[ContentType.FormData]: (input: any) => {
154+
if (input instanceof FormData) {
155+
return input;
156+
}
157+
158+
return Object.keys(input || {}).reduce((formData, key) => {
155159
const property = input[key];
156160
formData.append(
157161
key,
@@ -162,7 +166,8 @@ export class HttpClient<SecurityDataType = unknown> {
162166
: \`\${property}\`,
163167
);
164168
return formData;
165-
}, new FormData()),
169+
}, new FormData());
170+
},
166171
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
167172
};
168173

tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ export class HttpClient<SecurityDataType = unknown> {
110110
[ContentType.Json]: (input: any) =>
111111
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
112112
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
113-
[ContentType.FormData]: (input: any) =>
114-
Object.keys(input || {}).reduce((formData, key) => {
113+
[ContentType.FormData]: (input: any) => {
114+
if (input instanceof FormData) {
115+
return input;
116+
}
117+
118+
return Object.keys(input || {}).reduce((formData, key) => {
115119
const property = input[key];
116120
formData.append(
117121
key,
@@ -122,7 +126,8 @@ export class HttpClient<SecurityDataType = unknown> {
122126
: \`\${property}\`,
123127
);
124128
return formData;
125-
}, new FormData()),
129+
}, new FormData());
130+
},
126131
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
127132
};
128133

tests/spec/deprecated/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ export class HttpClient<SecurityDataType = unknown> {
110110
[ContentType.Json]: (input: any) =>
111111
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
112112
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
113-
[ContentType.FormData]: (input: any) =>
114-
Object.keys(input || {}).reduce((formData, key) => {
113+
[ContentType.FormData]: (input: any) => {
114+
if (input instanceof FormData) {
115+
return input;
116+
}
117+
118+
return Object.keys(input || {}).reduce((formData, key) => {
115119
const property = input[key];
116120
formData.append(
117121
key,
@@ -122,7 +126,8 @@ export class HttpClient<SecurityDataType = unknown> {
122126
: \`\${property}\`,
123127
);
124128
return formData;
125-
}, new FormData()),
129+
}, new FormData());
130+
},
126131
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
127132
};
128133

tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ export class HttpClient<SecurityDataType = unknown> {
112112
[ContentType.Json]: (input: any) =>
113113
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
114114
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
115-
[ContentType.FormData]: (input: any) =>
116-
Object.keys(input || {}).reduce((formData, key) => {
115+
[ContentType.FormData]: (input: any) => {
116+
if (input instanceof FormData) {
117+
return input;
118+
}
119+
120+
return Object.keys(input || {}).reduce((formData, key) => {
117121
const property = input[key];
118122
formData.append(
119123
key,
@@ -124,7 +128,8 @@ export class HttpClient<SecurityDataType = unknown> {
124128
: \`\${property}\`,
125129
);
126130
return formData;
127-
}, new FormData()),
131+
}, new FormData());
132+
},
128133
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
129134
};
130135

tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,12 @@ export class HttpClient<SecurityDataType = unknown> {
302302
[ContentType.Json]: (input: any) =>
303303
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
304304
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
305-
[ContentType.FormData]: (input: any) =>
306-
Object.keys(input || {}).reduce((formData, key) => {
305+
[ContentType.FormData]: (input: any) => {
306+
if (input instanceof FormData) {
307+
return input;
308+
}
309+
310+
return Object.keys(input || {}).reduce((formData, key) => {
307311
const property = input[key];
308312
formData.append(
309313
key,
@@ -314,7 +318,8 @@ export class HttpClient<SecurityDataType = unknown> {
314318
: \`\${property}\`,
315319
);
316320
return formData;
317-
}, new FormData()),
321+
}, new FormData());
322+
},
318323
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
319324
};
320325

tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,12 @@ export class HttpClient<SecurityDataType = unknown> {
263263
[ContentType.Json]: (input: any) =>
264264
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
265265
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
266-
[ContentType.FormData]: (input: any) =>
267-
Object.keys(input || {}).reduce((formData, key) => {
266+
[ContentType.FormData]: (input: any) => {
267+
if (input instanceof FormData) {
268+
return input;
269+
}
270+
271+
return Object.keys(input || {}).reduce((formData, key) => {
268272
const property = input[key];
269273
formData.append(
270274
key,
@@ -275,7 +279,8 @@ export class HttpClient<SecurityDataType = unknown> {
275279
: \`\${property}\`,
276280
);
277281
return formData;
278-
}, new FormData()),
282+
}, new FormData());
283+
},
279284
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
280285
};
281286

0 commit comments

Comments
 (0)