Skip to content

Commit f777df5

Browse files
committed
test: refactor
1 parent b5d1c83 commit f777df5

File tree

3 files changed

+428
-400
lines changed

3 files changed

+428
-400
lines changed

test/e2e/__snapshots__/proxy.test.js.snap.webpack4

+76-76
Original file line numberDiff line numberDiff line change
@@ -32,39 +32,87 @@ exports[`proxy option as an array without the \`route\` option respects a proxy
3232

3333
exports[`proxy option as an array without the \`route\` option respects a proxy option: response text 1`] = `"from proxy1"`;
3434

35-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path regardless of the target defined a bypass option: console messages 1`] = `Array []`;
35+
exports[`proxy option as an object of paths with properties respects a pathRewrite option: console messages 1`] = `Array []`;
3636

37-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path regardless of the target defined a bypass option: page errors 1`] = `Array []`;
37+
exports[`proxy option as an object of paths with properties respects a pathRewrite option: page errors 1`] = `Array []`;
3838

39-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path regardless of the target defined a bypass option: response status 1`] = `200`;
39+
exports[`proxy option as an object of paths with properties respects a pathRewrite option: response status 1`] = `200`;
4040

41-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path regardless of the target defined a bypass option: response text 1`] = `
41+
exports[`proxy option as an object of paths with properties respects a pathRewrite option: response text 1`] = `"from proxy2"`;
42+
43+
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: console messages 1`] = `Array []`;
44+
45+
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
46+
47+
exports[`proxy option as an object of paths with properties respects a proxy option when a request path is matched: response status 1`] = `200`;
48+
49+
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"`;
50+
51+
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: console messages 1`] = `Array []`;
52+
53+
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: page errors 1`] = `Array []`;
54+
55+
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: response status 1`] = `200`;
56+
57+
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: response text 1`] = `"from proxy1"`;
58+
59+
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: console messages 1`] = `Array []`;
60+
61+
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: page errors 1`] = `Array []`;
62+
63+
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: response status 1`] = `200`;
64+
65+
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: response text 1`] = `"from proxy1"`;
66+
67+
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: console messages 1`] = `Array []`;
68+
69+
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: page errors 1`] = `Array []`;
70+
71+
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: response status 1`] = `200`;
72+
73+
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: response text 1`] = `"from proxy1"`;
74+
75+
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: console messages 1`] = `Array []`;
76+
77+
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: page errors 1`] = `Array []`;
78+
79+
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: response status 1`] = `200`;
80+
81+
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: response text 1`] = `"from proxy1"`;
82+
83+
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: console messages 1`] = `Array []`;
84+
85+
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: page errors 1`] = `Array []`;
86+
87+
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: response status 1`] = `200`;
88+
89+
exports[`proxy option proxy with byPass can rewrite a request path regardless of the target defined a bypass option: response text 1`] = `
4290
"Hello
4391
"
4492
`;
4593

46-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path: console messages 1`] = `Array []`;
94+
exports[`proxy option proxy with byPass can rewrite a request path: console messages 1`] = `Array []`;
4795

48-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path: page errors 1`] = `Array []`;
96+
exports[`proxy option proxy with byPass can rewrite a request path: page errors 1`] = `Array []`;
4997

50-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path: response status 1`] = `200`;
98+
exports[`proxy option proxy with byPass can rewrite a request path: response status 1`] = `200`;
5199

52-
exports[`proxy option as an object of paths with properties byPass can rewrite a request path: response text 1`] = `
100+
exports[`proxy option proxy with byPass can rewrite a request path: response text 1`] = `
53101
"Hello
54102
"
55103
`;
56104

57-
exports[`proxy option as an object of paths with properties byPass should not pass through a proxy when a bypass function returns false: console messages 1`] = `
105+
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: console messages 1`] = `
58106
Array [
59107
"Failed to load resource: the server responded with a status of 404 (Not Found)",
60108
]
61109
`;
62110

63-
exports[`proxy option as an object of paths with properties byPass should not pass through a proxy when a bypass function returns false: page errors 1`] = `Array []`;
111+
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: page errors 1`] = `Array []`;
64112

65-
exports[`proxy option as an object of paths with properties byPass should not pass through a proxy when a bypass function returns false: response status 1`] = `404`;
113+
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: response status 1`] = `404`;
66114

67-
exports[`proxy option as an object of paths with properties byPass should not pass through a proxy when a bypass function returns false: response text 1`] = `
115+
exports[`proxy option proxy with byPass should not pass through a proxy when a bypass function returns false: response text 1`] = `
68116
"<!DOCTYPE html>
69117
<html lang=\\"en\\">
70118
<head>
@@ -78,49 +126,49 @@ exports[`proxy option as an object of paths with properties byPass should not pa
78126
"
79127
`;
80128

81-
exports[`proxy option as an object of paths with properties byPass should pass through a proxy when a bypass function returns null: console messages 1`] = `Array []`;
129+
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: console messages 1`] = `Array []`;
82130

83-
exports[`proxy option as an object of paths with properties byPass should pass through a proxy when a bypass function returns null: page errors 1`] = `Array []`;
131+
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: page errors 1`] = `Array []`;
84132

85-
exports[`proxy option as an object of paths with properties byPass should pass through a proxy when a bypass function returns null: response status 1`] = `200`;
133+
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: response status 1`] = `200`;
86134

87-
exports[`proxy option as an object of paths with properties byPass should pass through a proxy when a bypass function returns null: response text 1`] = `
135+
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: response text 1`] = `
88136
"\\"use strict\\";
89137

90138
console.log(\\"Hey.\\");
91139
"
92140
`;
93141

94-
exports[`proxy option as an object of paths with properties byPass should wait if bypass returns promise: console messages 1`] = `Array []`;
142+
exports[`proxy option proxy with byPass should wait if bypass returns promise: console messages 1`] = `Array []`;
95143

96-
exports[`proxy option as an object of paths with properties byPass should wait if bypass returns promise: page errors 1`] = `Array []`;
144+
exports[`proxy option proxy with byPass should wait if bypass returns promise: page errors 1`] = `Array []`;
97145

98-
exports[`proxy option as an object of paths with properties byPass should wait if bypass returns promise: response status 1`] = `200`;
146+
exports[`proxy option proxy with byPass should wait if bypass returns promise: response status 1`] = `200`;
99147

100-
exports[`proxy option as an object of paths with properties byPass should wait if bypass returns promise: response text 1`] = `"proxy async response"`;
148+
exports[`proxy option proxy with byPass should wait if bypass returns promise: response text 1`] = `"proxy async response"`;
101149

102-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option #2: console messages 1`] = `Array []`;
150+
exports[`proxy option proxy with byPass should work with the 'target' option #2: console messages 1`] = `Array []`;
103151

104-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option #2: page errors 1`] = `Array []`;
152+
exports[`proxy option proxy with byPass should work with the 'target' option #2: page errors 1`] = `Array []`;
105153

106-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option #2: response status 1`] = `200`;
154+
exports[`proxy option proxy with byPass should work with the 'target' option #2: response status 1`] = `200`;
107155

108-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option #2: response text 1`] = `
156+
exports[`proxy option proxy with byPass should work with the 'target' option #2: response text 1`] = `
109157
"Hello
110158
"
111159
`;
112160

113-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option: console messages 1`] = `
161+
exports[`proxy option proxy with byPass should work with the 'target' option: console messages 1`] = `
114162
Array [
115163
"Failed to load resource: the server responded with a status of 404 (Not Found)",
116164
]
117165
`;
118166

119-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option: page errors 1`] = `Array []`;
167+
exports[`proxy option proxy with byPass should work with the 'target' option: page errors 1`] = `Array []`;
120168

121-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option: response status 1`] = `404`;
169+
exports[`proxy option proxy with byPass should work with the 'target' option: response status 1`] = `404`;
122170

123-
exports[`proxy option as an object of paths with properties byPass should work with the 'target' option: response text 1`] = `
171+
exports[`proxy option proxy with byPass should work with the 'target' option: response text 1`] = `
124172
"<!DOCTYPE html>
125173
<html lang=\\"en\\">
126174
<head>
@@ -134,54 +182,6 @@ exports[`proxy option as an object of paths with properties byPass should work w
134182
"
135183
`;
136184

137-
exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: console messages 1`] = `Array []`;
138-
139-
exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: page errors 1`] = `Array []`;
140-
141-
exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: response status 1`] = `200`;
142-
143-
exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: response text 1`] = `"from proxy2"`;
144-
145-
exports[`proxy option as an object of paths with properties target respects a proxy option when a request path is matched: console messages 1`] = `Array []`;
146-
147-
exports[`proxy option as an object of paths with properties target respects a proxy option when a request path is matched: page errors 1`] = `Array []`;
148-
149-
exports[`proxy option as an object of paths with properties target respects a proxy option when a request path is matched: response status 1`] = `200`;
150-
151-
exports[`proxy option as an object of paths with properties target respects a proxy option when a request path is matched: response text 1`] = `"from proxy1"`;
152-
153-
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: console messages 1`] = `Array []`;
154-
155-
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: page errors 1`] = `Array []`;
156-
157-
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: response status 1`] = `200`;
158-
159-
exports[`proxy option as an option is an object with \`context\` and \`target\` as string respects a proxy option: response text 1`] = `"from proxy1"`;
160-
161-
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: console messages 1`] = `Array []`;
162-
163-
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: page errors 1`] = `Array []`;
164-
165-
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: response status 1`] = `200`;
166-
167-
exports[`proxy option as an option is an object with the \`context\` option respects a proxy option: response text 1`] = `"from proxy1"`;
168-
169-
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: console messages 1`] = `Array []`;
170-
171-
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: page errors 1`] = `Array []`;
172-
173-
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: response status 1`] = `200`;
174-
175-
exports[`proxy option as an option is an object with the \`path\` option (\`context\` alias) respects a proxy option: response text 1`] = `"from proxy1"`;
176-
177-
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: console messages 1`] = `Array []`;
178-
179-
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: page errors 1`] = `Array []`;
180-
181-
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: response status 1`] = `200`;
182-
183-
exports[`proxy option as an option is an object with the \`router\` option respects a proxy option: response text 1`] = `"from proxy1"`;
184-
185185
exports[`proxy option should handles external websocket upgrade with webSocketServerType: sockjs Should receive response: console messages 1`] = `
186186
Array [
187187
"Failed to load resource: the server responded with a status of 426 (Upgrade Required)",

0 commit comments

Comments
 (0)