Skip to content

Commit 20fe4c7

Browse files
authored
test: add e2e tests for \invalidate\ api method (#4112)
1 parent 6f7ef16 commit 20fe4c7

File tree

4 files changed

+498
-356
lines changed

4 files changed

+498
-356
lines changed
Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

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

12-
exports[`API should work and allow to rerun dev server multiple times: console messages 2`] = `
12+
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: page errors 1`] = `Array []`;
13+
14+
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: response status 1`] = `200`;
15+
16+
exports[`API Invalidate callback should use the provided \`callback\` function: console messages 1`] = `
1317
Array [
1418
"[HMR] Waiting for update signal from WDS...",
1519
"Hey.",
@@ -18,22 +22,24 @@ Array [
1822
]
1923
`;
2024

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

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

25-
exports[`API should work when using configured manually: console messages 1`] = `
29+
exports[`API deprecated API should log warning when the "port" and "host" options from options different from arguments ('listen' method): console messages 1`] = `
2630
Array [
2731
"[HMR] Waiting for update signal from WDS...",
28-
"[webpack-dev-server] Hot Module Replacement enabled.",
2932
"Hey.",
33+
"[webpack-dev-server] Hot Module Replacement enabled.",
3034
"[webpack-dev-server] Live Reloading enabled.",
3135
]
3236
`;
3337

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

36-
exports[`API should work with async API: console messages 1`] = `
40+
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."`;
41+
42+
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
3743
Array [
3844
"[HMR] Waiting for update signal from WDS...",
3945
"Hey.",
@@ -42,9 +48,11 @@ Array [
4248
]
4349
`;
4450

45-
exports[`API should work with async API: page errors 1`] = `Array []`;
51+
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."`;
52+
53+
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
4654

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

56-
exports[`API should work with callback API: page errors 1`] = `Array []`;
64+
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."`;
5765

58-
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."`;
66+
exports[`API deprecated API should work with deprecated API (only compiler in constructor): page errors 1`] = `Array []`;
5967

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

69-
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."`;
77+
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."`;
7078

71-
exports[`API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
79+
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;
80+
81+
exports[`API latest async API should work and allow to rerun dev server multiple times: console messages 1`] = `
82+
Array [
83+
"[HMR] Waiting for update signal from WDS...",
84+
"Hey.",
85+
"[webpack-dev-server] Hot Module Replacement enabled.",
86+
"[webpack-dev-server] Live Reloading enabled.",
87+
]
88+
`;
7289

73-
exports[`API should work with deprecated API (only compiler in constructor): console messages 1`] = `
90+
exports[`API latest async API should work and allow to rerun dev server multiple times: console messages 2`] = `
7491
Array [
7592
"[HMR] Waiting for update signal from WDS...",
7693
"Hey.",
@@ -79,11 +96,22 @@ Array [
7996
]
8097
`;
8198

82-
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."`;
99+
exports[`API latest async API should work and allow to rerun dev server multiple times: page errors 1`] = `Array []`;
83100

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

86-
exports[`API should work with deprecated API (the order of the arguments in the constructor): console messages 1`] = `
103+
exports[`API latest async API should work when using configured manually: console messages 1`] = `
104+
Array [
105+
"[HMR] Waiting for update signal from WDS...",
106+
"[webpack-dev-server] Hot Module Replacement enabled.",
107+
"Hey.",
108+
"[webpack-dev-server] Live Reloading enabled.",
109+
]
110+
`;
111+
112+
exports[`API latest async API should work when using configured manually: page errors 1`] = `Array []`;
113+
114+
exports[`API latest async API should work with async API: console messages 1`] = `
87115
Array [
88116
"[HMR] Waiting for update signal from WDS...",
89117
"Hey.",
@@ -92,6 +120,15 @@ Array [
92120
]
93121
`;
94122

95-
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."`;
123+
exports[`API latest async API should work with async API: page errors 1`] = `Array []`;
124+
125+
exports[`API latest async API should work with callback API: console messages 1`] = `
126+
Array [
127+
"[HMR] Waiting for update signal from WDS...",
128+
"Hey.",
129+
"[webpack-dev-server] Hot Module Replacement enabled.",
130+
"[webpack-dev-server] Live Reloading enabled.",
131+
]
132+
`;
96133

97-
exports[`API should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;
134+
exports[`API latest async API should work with callback API: page errors 1`] = `Array []`;
Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

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

12-
exports[`API should work and allow to rerun dev server multiple times: console messages 2`] = `
12+
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: page errors 1`] = `Array []`;
13+
14+
exports[`API Invalidate callback should use the default \`noop\` callback when invalidate is called without any callback: response status 1`] = `200`;
15+
16+
exports[`API Invalidate callback should use the provided \`callback\` function: console messages 1`] = `
1317
Array [
1418
"[HMR] Waiting for update signal from WDS...",
1519
"Hey.",
@@ -18,22 +22,24 @@ Array [
1822
]
1923
`;
2024

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

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

25-
exports[`API should work when using configured manually: console messages 1`] = `
29+
exports[`API deprecated API should log warning when the "port" and "host" options from options different from arguments ('listen' method): console messages 1`] = `
2630
Array [
2731
"[HMR] Waiting for update signal from WDS...",
28-
"[webpack-dev-server] Hot Module Replacement enabled.",
2932
"Hey.",
33+
"[webpack-dev-server] Hot Module Replacement enabled.",
3034
"[webpack-dev-server] Live Reloading enabled.",
3135
]
3236
`;
3337

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

36-
exports[`API should work with async API: console messages 1`] = `
40+
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."`;
41+
42+
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): console messages 1`] = `
3743
Array [
3844
"[HMR] Waiting for update signal from WDS...",
3945
"Hey.",
@@ -42,9 +48,11 @@ Array [
4248
]
4349
`;
4450

45-
exports[`API should work with async API: page errors 1`] = `Array []`;
51+
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."`;
52+
53+
exports[`API deprecated API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
4654

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

56-
exports[`API should work with callback API: page errors 1`] = `Array []`;
64+
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."`;
5765

58-
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."`;
66+
exports[`API deprecated API should work with deprecated API (only compiler in constructor): page errors 1`] = `Array []`;
5967

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

69-
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."`;
77+
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."`;
7078

71-
exports[`API should work with deprecated API ('listen' and 'close' methods): page errors 1`] = `Array []`;
79+
exports[`API deprecated API should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;
80+
81+
exports[`API latest async API should work and allow to rerun dev server multiple times: console messages 1`] = `
82+
Array [
83+
"[HMR] Waiting for update signal from WDS...",
84+
"Hey.",
85+
"[webpack-dev-server] Hot Module Replacement enabled.",
86+
"[webpack-dev-server] Live Reloading enabled.",
87+
]
88+
`;
7289

73-
exports[`API should work with deprecated API (only compiler in constructor): console messages 1`] = `
90+
exports[`API latest async API should work and allow to rerun dev server multiple times: console messages 2`] = `
7491
Array [
7592
"[HMR] Waiting for update signal from WDS...",
7693
"Hey.",
@@ -79,11 +96,22 @@ Array [
7996
]
8097
`;
8198

82-
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."`;
99+
exports[`API latest async API should work and allow to rerun dev server multiple times: page errors 1`] = `Array []`;
83100

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

86-
exports[`API should work with deprecated API (the order of the arguments in the constructor): console messages 1`] = `
103+
exports[`API latest async API should work when using configured manually: console messages 1`] = `
104+
Array [
105+
"[HMR] Waiting for update signal from WDS...",
106+
"[webpack-dev-server] Hot Module Replacement enabled.",
107+
"Hey.",
108+
"[webpack-dev-server] Live Reloading enabled.",
109+
]
110+
`;
111+
112+
exports[`API latest async API should work when using configured manually: page errors 1`] = `Array []`;
113+
114+
exports[`API latest async API should work with async API: console messages 1`] = `
87115
Array [
88116
"[HMR] Waiting for update signal from WDS...",
89117
"Hey.",
@@ -92,6 +120,15 @@ Array [
92120
]
93121
`;
94122

95-
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."`;
123+
exports[`API latest async API should work with async API: page errors 1`] = `Array []`;
124+
125+
exports[`API latest async API should work with callback API: console messages 1`] = `
126+
Array [
127+
"[HMR] Waiting for update signal from WDS...",
128+
"Hey.",
129+
"[webpack-dev-server] Hot Module Replacement enabled.",
130+
"[webpack-dev-server] Live Reloading enabled.",
131+
]
132+
`;
96133

97-
exports[`API should work with deprecated API (the order of the arguments in the constructor): page errors 1`] = `Array []`;
134+
exports[`API latest async API should work with callback API: page errors 1`] = `Array []`;

0 commit comments

Comments
 (0)