Skip to content

Commit

Permalink
test: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Oct 18, 2021
1 parent de13b6a commit f2d6da3
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 400 deletions.
152 changes: 76 additions & 76 deletions test/e2e/__snapshots__/proxy.test.js.snap.webpack4
Expand Up @@ -32,39 +32,87 @@ exports[`proxy option as an array without the \`route\` option respects a proxy

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 byPass can rewrite a request path regardless of the target defined a bypass option: console messages 1`] = `Array []`;
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 byPass can rewrite a request path regardless of the target defined a bypass option: page errors 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 byPass can rewrite a request path regardless of the target defined a bypass option: response status 1`] = `200`;
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 byPass can rewrite a request path regardless of the target defined a bypass option: response text 1`] = `
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 as an object of paths with properties byPass can rewrite a request path: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass can rewrite a request path: console messages 1`] = `Array []`;

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

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

exports[`proxy option as an object of paths with properties byPass can rewrite a request path: response text 1`] = `
exports[`proxy option proxy with byPass can rewrite a request path: response text 1`] = `
"Hello
"
`;

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`] = `
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 as an object of paths with properties 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: page errors 1`] = `Array []`;

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`;
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 as an object of paths with properties byPass should not pass through a proxy when a bypass function returns false: response text 1`] = `
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>
Expand All @@ -78,49 +126,49 @@ exports[`proxy option as an object of paths with properties byPass should not pa
"
`;

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 []`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: console messages 1`] = `Array []`;

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 []`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: page errors 1`] = `Array []`;

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`;
exports[`proxy option proxy with byPass should pass through a proxy when a bypass function returns null: response status 1`] = `200`;

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`] = `
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 as an object of paths with properties byPass should wait if bypass returns promise: console messages 1`] = `Array []`;
exports[`proxy option proxy with byPass should wait if bypass returns promise: console messages 1`] = `Array []`;

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

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

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

exports[`proxy option as an object of paths with properties 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: console messages 1`] = `Array []`;

exports[`proxy option as an object of paths with properties 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: page errors 1`] = `Array []`;

exports[`proxy option as an object of paths with properties 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 status 1`] = `200`;

exports[`proxy option as an object of paths with properties byPass should work with the 'target' option #2: response text 1`] = `
exports[`proxy option proxy with byPass should work with the 'target' option #2: response text 1`] = `
"Hello
"
`;

exports[`proxy option as an object of paths with properties byPass should work with the 'target' option: console messages 1`] = `
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 as an object of paths with properties byPass should work with the 'target' option: page errors 1`] = `Array []`;
exports[`proxy option proxy with byPass should work with the 'target' option: page errors 1`] = `Array []`;

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

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

exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: console messages 1`] = `Array []`;

exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: page errors 1`] = `Array []`;

exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: response status 1`] = `200`;

exports[`proxy option as an object of paths with properties pathRewrite respects a pathRewrite option: response text 1`] = `"from proxy2"`;

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 []`;

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 []`;

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`;

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"`;

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 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)",
Expand Down

0 comments on commit f2d6da3

Please sign in to comment.