Skip to content

test: add e2e tests for invalidate api method #4112

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 1 commit into from
Dec 15, 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
79 changes: 58 additions & 21 deletions test/e2e/__snapshots__/api.test.js.snap.webpack4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`API should work and allow to rerun dev server multiple times: console messages 1`] = `
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -9,7 +9,11 @@ Array [
]
`;

exports[`API should work and allow to rerun dev server multiple times: console messages 2`] = `
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: page errors 1`] = `Array []`;

exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: response status 1`] = `200`;

exports[`API Invalidate callback should use the provided \`callback\` function: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -18,22 +22,24 @@ Array [
]
`;

exports[`API should work and allow to rerun dev server multiple times: page errors 1`] = `Array []`;
exports[`API Invalidate callback should use the provided \`callback\` function: page errors 1`] = `Array []`;

exports[`API should work and allow to rerun dev server multiple times: page errors 2`] = `Array []`;
exports[`API Invalidate callback should use the provided \`callback\` function: response status 1`] = `200`;

exports[`API should work when using configured manually: console messages 1`] = `
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...",
"[webpack-dev-server] Hot Module Replacement enabled.",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API should work when using configured manually: page errors 1`] = `Array []`;
exports[`API deprecated API should log warning when the "port" and "host" options from options different from arguments ('listen' method): page errors 1`] = `Array []`;

exports[`API should work with async API: console messages 1`] = `
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): close deprecation log 1`] = `"'close' is deprecated. Please use the async 'stop' or 'stopCallback' method."`;

exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -42,9 +48,11 @@ Array [
]
`;

exports[`API should work with async API: page errors 1`] = `Array []`;
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): listen deprecation log 1`] = `"'listen' is deprecated. Please use the async 'start' or 'startCallback' method."`;

exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;

exports[`API should work with callback API: console messages 1`] = `
exports[`API deprecated API should work with deprecated API (only compiler in constructor): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -53,11 +61,11 @@ Array [
]
`;

exports[`API should work with callback API: page errors 1`] = `Array []`;
exports[`API deprecated API should work with deprecated API (only compiler in constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;

exports[`API should work with deprecated API ('listen' and 'close' methods): close deprecation log 1`] = `"'close' is deprecated. Please use the async 'stop' or 'stopCallback' method."`;
exports[`API deprecated API should work with deprecated API (only compiler in constructor): page errors 1`] = `Array []`;

exports[`API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -66,11 +74,20 @@ Array [
]
`;

exports[`API should work with deprecated API ('listen' and 'close' methods): listen deprecation log 1`] = `"'listen' is deprecated. Please use the async 'start' or 'startCallback' method."`;
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;

exports[`API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;

exports[`API latest async API should work and allow to rerun dev server multiple times: 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 should work with deprecated API (only compiler in constructor): console messages 1`] = `
exports[`API latest async API should work and allow to rerun dev server multiple times: console messages 2`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -79,11 +96,22 @@ Array [
]
`;

exports[`API should work with deprecated API (only compiler in constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;
exports[`API latest async API should work and allow to rerun dev server multiple times: page errors 1`] = `Array []`;

exports[`API should work with deprecated API (only compiler in constructor): page errors 1`] = `Array []`;
exports[`API latest async API should work and allow to rerun dev server multiple times: page errors 2`] = `Array []`;

exports[`API should work with deprecated API (the order of the arguments in the constructor): console messages 1`] = `
exports[`API latest async API should work when using configured manually: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"[webpack-dev-server] Hot Module Replacement enabled.",
"Hey.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API latest async API should work when using configured manually: page errors 1`] = `Array []`;

exports[`API latest async API should work with async API: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -92,6 +120,15 @@ Array [
]
`;

exports[`API should work with deprecated API (the order of the arguments in the constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;
exports[`API latest async API should work with async API: page errors 1`] = `Array []`;

exports[`API latest async API should work with callback API: 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 should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;
exports[`API latest async API should work with callback API: page errors 1`] = `Array []`;
79 changes: 58 additions & 21 deletions test/e2e/__snapshots__/api.test.js.snap.webpack5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`API should work and allow to rerun dev server multiple times: console messages 1`] = `
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -9,7 +9,11 @@ Array [
]
`;

exports[`API should work and allow to rerun dev server multiple times: console messages 2`] = `
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: page errors 1`] = `Array []`;

exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: response status 1`] = `200`;

exports[`API Invalidate callback should use the provided \`callback\` function: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -18,22 +22,24 @@ Array [
]
`;

exports[`API should work and allow to rerun dev server multiple times: page errors 1`] = `Array []`;
exports[`API Invalidate callback should use the provided \`callback\` function: page errors 1`] = `Array []`;

exports[`API should work and allow to rerun dev server multiple times: page errors 2`] = `Array []`;
exports[`API Invalidate callback should use the provided \`callback\` function: response status 1`] = `200`;

exports[`API should work when using configured manually: console messages 1`] = `
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...",
"[webpack-dev-server] Hot Module Replacement enabled.",
"Hey.",
"[webpack-dev-server] Hot Module Replacement enabled.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API should work when using configured manually: page errors 1`] = `Array []`;
exports[`API deprecated API should log warning when the "port" and "host" options from options different from arguments ('listen' method): page errors 1`] = `Array []`;

exports[`API should work with async API: console messages 1`] = `
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): close deprecation log 1`] = `"'close' is deprecated. Please use the async 'stop' or 'stopCallback' method."`;

exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -42,9 +48,11 @@ Array [
]
`;

exports[`API should work with async API: page errors 1`] = `Array []`;
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): listen deprecation log 1`] = `"'listen' is deprecated. Please use the async 'start' or 'startCallback' method."`;

exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;

exports[`API should work with callback API: console messages 1`] = `
exports[`API deprecated API should work with deprecated API (only compiler in constructor): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -53,11 +61,11 @@ Array [
]
`;

exports[`API should work with callback API: page errors 1`] = `Array []`;
exports[`API deprecated API should work with deprecated API (only compiler in constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;

exports[`API should work with deprecated API ('listen' and 'close' methods): close deprecation log 1`] = `"'close' is deprecated. Please use the async 'stop' or 'stopCallback' method."`;
exports[`API deprecated API should work with deprecated API (only compiler in constructor): page errors 1`] = `Array []`;

exports[`API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -66,11 +74,20 @@ Array [
]
`;

exports[`API should work with deprecated API ('listen' and 'close' methods): listen deprecation log 1`] = `"'listen' is deprecated. Please use the async 'start' or 'startCallback' method."`;
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;

exports[`API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;

exports[`API latest async API should work and allow to rerun dev server multiple times: 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 should work with deprecated API (only compiler in constructor): console messages 1`] = `
exports[`API latest async API should work and allow to rerun dev server multiple times: console messages 2`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -79,11 +96,22 @@ Array [
]
`;

exports[`API should work with deprecated API (only compiler in constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;
exports[`API latest async API should work and allow to rerun dev server multiple times: page errors 1`] = `Array []`;

exports[`API should work with deprecated API (only compiler in constructor): page errors 1`] = `Array []`;
exports[`API latest async API should work and allow to rerun dev server multiple times: page errors 2`] = `Array []`;

exports[`API should work with deprecated API (the order of the arguments in the constructor): console messages 1`] = `
exports[`API latest async API should work when using configured manually: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"[webpack-dev-server] Hot Module Replacement enabled.",
"Hey.",
"[webpack-dev-server] Live Reloading enabled.",
]
`;

exports[`API latest async API should work when using configured manually: page errors 1`] = `Array []`;

exports[`API latest async API should work with async API: console messages 1`] = `
Array [
"[HMR] Waiting for update signal from WDS...",
"Hey.",
Expand All @@ -92,6 +120,15 @@ Array [
]
`;

exports[`API should work with deprecated API (the order of the arguments in the constructor): deprecation log 1`] = `"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument."`;
exports[`API latest async API should work with async API: page errors 1`] = `Array []`;

exports[`API latest async API should work with callback API: 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 should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;
exports[`API latest async API should work with callback API: page errors 1`] = `Array []`;
Loading