-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathproxy.test.js.snap.webpack4
More file actions
335 lines (204 loc) · 18.2 KB
/
proxy.test.js.snap.webpack4
File metadata and controls
335 lines (204 loc) · 18.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`proxy option as an array respects a proxy option of function: console messages 1`] = `Array []`;
exports[`proxy option as an array respects a proxy option of function: page errors 1`] = `Array []`;
exports[`proxy option as an array respects a proxy option of function: response status 1`] = `200`;
exports[`proxy option as an array respects a proxy option of function: response text 1`] = `"from proxy2"`;
exports[`proxy option as an array respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option as an array respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option as an array respects a proxy option: response status 1`] = `200`;
exports[`proxy option as an array respects a proxy option: response text 1`] = `"from proxy1"`;
exports[`proxy option as an array should allow req, res, and next: console messages 1`] = `Array []`;
exports[`proxy option as an array should allow req, res, and next: page errors 1`] = `Array []`;
exports[`proxy option as an array should allow req, res, and next: response status 1`] = `200`;
exports[`proxy option as an array should allow req, res, and next: response text 1`] = `"foo+next+function"`;
exports[`proxy option as an array without the \`route\` option respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option as an array without the \`route\` option respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option as an array without the \`route\` option respects a proxy option: response status 1`] = `200`;
exports[`proxy option as an array without the \`route\` option respects a proxy option: response text 1`] = `"from proxy1"`;
exports[`proxy option as an object of paths with properties respects a pathRewrite option: console messages 1`] = `Array []`;
exports[`proxy option as an object of paths with properties respects a pathRewrite option: page errors 1`] = `Array []`;
exports[`proxy option as an object of paths with properties respects a pathRewrite option: response status 1`] = `200`;
exports[`proxy option as an object of paths with properties respects a pathRewrite option: response text 1`] = `"from proxy2"`;
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: console messages 1`] = `Array []`;
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: response status 1`] = `200`;
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: response text 1`] = `"from proxy1"`;
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: response status 1`] = `200`;
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: response text 1`] = `"from proxy1"`;
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: response status 1`] = `200`;
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: response text 1`] = `"from proxy1"`;
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: response status 1`] = `200`;
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: response text 1`] = `"from proxy1"`;
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: response status 1`] = `200`;
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: response text 1`] = `"from proxy1"`;
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: response status 1`] = `200`;
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: response text 1`] = `
"Hello
"
`;
exports[`proxy option proxy with byPass can rewrite a request path: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass can rewrite a request path: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass can rewrite a request path: response status 1`] = `200`;
exports[`proxy option proxy with byPass can rewrite a request path: response text 1`] = `
"Hello
"
`;
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: response status 1`] = `404`;
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: response text 1`] = `
"<!DOCTYPE html>
<html lang=\\"en\\">
<head>
<meta charset=\\"utf-8\\">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /proxyfalse</pre>
</body>
</html>
"
`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: response status 1`] = `200`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: response text 1`] = `
"\\"use strict\\";
console.log(\\"Hey.\\");
"
`;
exports[`proxy option proxy with byPass should wait if bypass returns promise: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass should wait if bypass returns promise: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass should wait if bypass returns promise: response status 1`] = `200`;
exports[`proxy option proxy with byPass should wait if bypass returns promise: response text 1`] = `"proxy async response"`;
exports[`proxy option proxy with byPass should work with the 'target' option #2: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass should work with the 'target' option #2: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass should work with the 'target' option #2: response status 1`] = `200`;
exports[`proxy option proxy with byPass should work with the 'target' option #2: response text 1`] = `
"Hello
"
`;
exports[`proxy option proxy with byPass should work with the 'target' option: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 404 (Not Found)",
]
`;
exports[`proxy option proxy with byPass should work with the 'target' option: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass should work with the 'target' option: response status 1`] = `404`;
exports[`proxy option proxy with byPass should work with the 'target' option: response text 1`] = `
"<!DOCTYPE html>
<html lang=\\"en\\">
<head>
<meta charset=\\"utf-8\\">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /bypass-with-target/foo.js</pre>
</body>
</html>
"
`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: sockjs Should receive response: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 426 (Upgrade Required)",
]
`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: sockjs Should receive response: page errors 1`] = `Array []`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: sockjs Should receive response: response status 1`] = `426`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: sockjs Should receive response: response text 1`] = `"Upgrade Required"`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: ws Should receive response: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 426 (Upgrade Required)",
]
`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: ws Should receive response: page errors 1`] = `Array []`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: ws Should receive response: response status 1`] = `426`;
exports[`proxy option should handles external websocket upgrade with webSocketServerType: ws Should receive response: response text 1`] = `"Upgrade Required"`;
exports[`proxy option should sharing a proxy option respects proxy1 option: console messages 1`] = `Array []`;
exports[`proxy option should sharing a proxy option respects proxy1 option: page errors 1`] = `Array []`;
exports[`proxy option should sharing a proxy option respects proxy1 option: response status 1`] = `200`;
exports[`proxy option should sharing a proxy option respects proxy1 option: response text 1`] = `"from proxy"`;
exports[`proxy option should sharing a proxy option respects proxy2 option: console messages 1`] = `Array []`;
exports[`proxy option should sharing a proxy option respects proxy2 option: page errors 1`] = `Array []`;
exports[`proxy option should sharing a proxy option respects proxy2 option: response status 1`] = `200`;
exports[`proxy option should sharing a proxy option respects proxy2 option: response text 1`] = `"from proxy"`;
exports[`proxy option should supports http methods DELETE method: console messages 1`] = `Array []`;
exports[`proxy option should supports http methods DELETE method: page errors 1`] = `Array []`;
exports[`proxy option should supports http methods DELETE method: response status 1`] = `200`;
exports[`proxy option should supports http methods DELETE method: response text 1`] = `"DELETE method from proxy"`;
exports[`proxy option should supports http methods GET method: console messages 1`] = `Array []`;
exports[`proxy option should supports http methods GET method: page errors 1`] = `Array []`;
exports[`proxy option should supports http methods GET method: response status 1`] = `200`;
exports[`proxy option should supports http methods GET method: response text 1`] = `"GET method from proxy"`;
exports[`proxy option should supports http methods HEAD method: console messages 1`] = `Array []`;
exports[`proxy option should supports http methods HEAD method: page errors 1`] = `Array []`;
exports[`proxy option should supports http methods HEAD method: response status 1`] = `200`;
exports[`proxy option should supports http methods HEAD method: response text 1`] = `""`;
exports[`proxy option should supports http methods POST method (application/json): console messages 1`] = `Array []`;
exports[`proxy option should supports http methods POST method (application/json): page errors 1`] = `Array []`;
exports[`proxy option should supports http methods POST method (application/json): response headers content-type 1`] = `"application/json; charset=utf-8"`;
exports[`proxy option should supports http methods POST method (application/json): response status 1`] = `200`;
exports[`proxy option should supports http methods POST method (application/json): response text 1`] = `"{\\"answer\\":\\"POST method from proxy (id: 1)\\"}"`;
exports[`proxy option should supports http methods POST method (application/x-www-form-urlencoded): console messages 1`] = `Array []`;
exports[`proxy option should supports http methods POST method (application/x-www-form-urlencoded): page errors 1`] = `Array []`;
exports[`proxy option should supports http methods POST method (application/x-www-form-urlencoded): response headers content-type 1`] = `"text/html; charset=utf-8"`;
exports[`proxy option should supports http methods POST method (application/x-www-form-urlencoded): response status 1`] = `200`;
exports[`proxy option should supports http methods POST method (application/x-www-form-urlencoded): response text 1`] = `"POST method from proxy (id: 1)"`;
exports[`proxy option should supports http methods errors: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 500 (Internal Server Error)",
]
`;
exports[`proxy option should supports http methods errors: page errors 1`] = `Array []`;
exports[`proxy option should supports http methods errors: response status 1`] = `500`;
exports[`proxy option should supports http methods errors: response text 1`] = `"error from proxy"`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options target respects a proxy option when a request path is matched: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 504 (Gateway Timeout)",
]
`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options target respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options target respects a proxy option when a request path is matched: response status 1`] = `504`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options target respects a proxy option when a request path is matched: response text 1`] = `"Error occured while trying to proxy: localhost:8123/my-path"`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options with \`silent\` value target respects a proxy option when a request path is matched: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 504 (Gateway Timeout)",
]
`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options with \`silent\` value target respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options with \`silent\` value target respects a proxy option when a request path is matched: response status 1`] = `504`;
exports[`proxy option should work and respect \`logProvider\` and \`logLevel\` options with \`silent\` value target respects a proxy option when a request path is matched: response text 1`] = `"Error occured while trying to proxy: localhost:8123/my-path"`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option target respects a proxy option when a request path is matched: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 504 (Gateway Timeout)",
]
`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option target respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option target respects a proxy option when a request path is matched: response status 1`] = `504`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option target respects a proxy option when a request path is matched: response text 1`] = `"Error occured while trying to proxy: localhost:8123/my-path"`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option with \`none\` value target respects a proxy option when a request path is matched: console messages 1`] = `
Array [
"Failed to load resource: the server responded with a status of 504 (Gateway Timeout)",
]
`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option with \`none\` value target respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option with \`none\` value target respects a proxy option when a request path is matched: response status 1`] = `504`;
exports[`proxy option should work and respect the \`infrastructureLogging.level\` option with \`none\` value target respects a proxy option when a request path is matched: response text 1`] = `"Error occured while trying to proxy: localhost:8123/my-path"`;
exports[`proxy option should work in multi compiler mode respects a proxy option: console messages 1`] = `Array []`;
exports[`proxy option should work in multi compiler mode respects a proxy option: page errors 1`] = `Array []`;
exports[`proxy option should work in multi compiler mode respects a proxy option: response status 1`] = `200`;
exports[`proxy option should work in multi compiler mode respects a proxy option: response text 1`] = `"from proxy1"`;