Skip to content

test: add e2e tests for getFreePort api method #4114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions test/e2e/__snapshots__/api.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,73 @@ exports[`API Invalidate callback should use the provided \`callback\` function:

exports[`API Invalidate callback should use the provided \`callback\` function: response status 1`] = `200`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): page errors 1`] = `Array []`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): response status 1`] = `200`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): page errors 1`] = `Array []`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): response status 1`] = `200`;

exports[`API Server.getFreePort should retry finding the port when serial ports are busy: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should retry finding the port when serial ports are busy: page errors 1`] = `Array []`;

exports[`API Server.getFreePort should retry finding the port when serial ports are busy: response status 1`] = `200`;

exports[`API Server.getFreePort should return the port when the port is \`null\`: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should return the port when the port is \`null\`: page errors 1`] = `Array []`;

exports[`API Server.getFreePort should return the port when the port is \`null\`: response status 1`] = `200`;

exports[`API Server.getFreePort should return the port when the port is undefined: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should return the port when the port is undefined: page errors 1`] = `Array []`;

exports[`API Server.getFreePort should return the port when the port is undefined: response status 1`] = `200`;

exports[`API Server.getFreePort should throw the error when the port isn't found 1`] = `"busy"`;

exports[`API deprecated API should log warning when the "port" and "host" options from options different from arguments ('listen' method): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
Expand Down
67 changes: 67 additions & 0 deletions test/e2e/__snapshots__/api.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,73 @@ exports[`API Invalidate callback should use the provided \`callback\` function:

exports[`API Invalidate callback should use the provided \`callback\` function: response status 1`] = `200`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): page errors 1`] = `Array []`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (number): response status 1`] = `200`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): page errors 1`] = `Array []`;

exports[`API Server.getFreePort should retry finding the port for up to defaultPortRetry times (string): response status 1`] = `200`;

exports[`API Server.getFreePort should retry finding the port when serial ports are busy: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should retry finding the port when serial ports are busy: page errors 1`] = `Array []`;

exports[`API Server.getFreePort should retry finding the port when serial ports are busy: response status 1`] = `200`;

exports[`API Server.getFreePort should return the port when the port is \`null\`: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should return the port when the port is \`null\`: page errors 1`] = `Array []`;

exports[`API Server.getFreePort should return the port when the port is \`null\`: response status 1`] = `200`;

exports[`API Server.getFreePort should return the port when the port is undefined: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API Server.getFreePort should return the port when the port is undefined: page errors 1`] = `Array []`;

exports[`API Server.getFreePort should return the port when the port is undefined: response status 1`] = `200`;

exports[`API Server.getFreePort should throw the error when the port isn't found 1`] = `"busy"`;

exports[`API deprecated API should log warning when the "port" and "host" options from options different from arguments ('listen' method): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
Expand Down
Loading