Skip to content

Commit e12147e

Browse files
committed
Update snapshots to make the tests pass
1 parent eb652fa commit e12147e

File tree

8 files changed

+212
-74
lines changed

8 files changed

+212
-74
lines changed

bin/cli-flags.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ module.exports = {
121121
simpleType: "boolean",
122122
multiple: false,
123123
},
124+
"client-overlay-trusted-types-policy-name": {
125+
configs: [
126+
{
127+
description:
128+
"The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.",
129+
multiple: false,
130+
path: "client.overlay.trustedTypesPolicyName",
131+
type: "string",
132+
},
133+
],
134+
description:
135+
"The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.",
136+
multiple: false,
137+
simpleType: "string",
138+
},
124139
"client-overlay-warnings": {
125140
configs: [
126141
{

test/cli/__snapshots__/http2-option.test.js.snap.webpack5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`"http2" CLI option should work using "--http2" 1`] = `
4-
"<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem
4+
"<i> [webpack-dev-server] Generating SSL certificate...
5+
<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem
56
<i> [webpack-dev-server] Project is running at:
67
<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/
78
<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/

test/cli/__snapshots__/https-option.test.js.snap.webpack5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ exports[`"https" CLI option should warn using "--https-cacert" and "--https-ca"
1010
`;
1111

1212
exports[`"https" CLI option should work using "--https" 1`] = `
13-
"<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem
13+
"<i> [webpack-dev-server] Generating SSL certificate...
14+
<i> [webpack-dev-server] SSL certificate: <cwd>/node_modules/.cache/webpack-dev-server/server.pem
1415
<i> [webpack-dev-server] Project is running at:
1516
<i> Loopback: https://localhost:<port>/, https://<ip-v4>:<port>/, https://[<ip-v6>]:<port>/
1617
<i> [webpack-dev-server] On Your Network (IPv4): https://<ip-v4>:<port>/

test/e2e/__snapshots__/hot-and-live-reload.test.js.snap.webpack5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ exports[`hot and live reload should work and allow to disable live reload using
5454
Array [
5555
"[webpack-dev-server] Live Reloading enabled.",
5656
"[webpack-dev-server] App updated. Recompiling...",
57-
"[webpack-dev-server] App updated. Recompiling...",
5857
]
5958
`;
6059

@@ -267,6 +266,8 @@ Array [
267266
"[webpack-dev-server] App updated. Recompiling...",
268267
"[webpack-dev-server] App hot update...",
269268
"[HMR] Checking for updates on the server...",
269+
"[webpack-dev-server] App updated. Recompiling...",
270+
"[webpack-dev-server] Nothing changed.",
270271
"[HMR] Updated modules:",
271272
"[HMR] - ./main.css",
272273
"[HMR] - ../../../node_modules/css-loader/dist/cjs.js!./main.css",

test/e2e/__snapshots__/overlay.test.js.snap.webpack5

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ exports[`overlay should not show initially, then show on an error, then show oth
364364
"
365365
`;
366366

367+
exports[`overlay should not show overlay when Trusted Types are enabled, but policy is not allowed: page html 1`] = `
368+
"<body>
369+
<h1>webpack-dev-server is running...</h1>
370+
<script type=\\"text/javascript\\" charset=\\"utf-8\\" src=\\"/main.js\\"></script>
371+
</body>
372+
"
373+
`;
374+
367375
exports[`overlay should show a warning after invalidation: overlay html 1`] = `
368376
"<body>
369377
<div
@@ -1319,3 +1327,68 @@ exports[`overlay should show an error when "client.overlay.warnings" is "true":
13191327
</body>
13201328
"
13211329
`;
1330+
1331+
exports[`overlay should show overlay when Trusted Types are enabled: overlay html 1`] = `
1332+
"<body>
1333+
<div
1334+
id=\\"webpack-dev-server-client-overlay-div\\"
1335+
style=\\"
1336+
position: fixed;
1337+
box-sizing: border-box;
1338+
inset: 0px;
1339+
width: 100vw;
1340+
height: 100vh;
1341+
background-color: rgba(0, 0, 0, 0.85);
1342+
color: rgb(232, 232, 232);
1343+
font-family: Menlo, Consolas, monospace;
1344+
font-size: large;
1345+
padding: 2rem;
1346+
line-height: 1.2;
1347+
white-space: pre-wrap;
1348+
overflow: auto;
1349+
\\"
1350+
>
1351+
<span>Compiled with problems:</span
1352+
><button
1353+
style=\\"
1354+
background: transparent;
1355+
border: none;
1356+
font-size: 20px;
1357+
font-weight: bold;
1358+
color: white;
1359+
cursor: pointer;
1360+
float: right;
1361+
\\"
1362+
>
1363+
X</button
1364+
><br /><br />
1365+
<div>
1366+
<span style=\\"color: rgb(227, 96, 73)\\">ERROR</span><br /><br />
1367+
<div>Error from compilation. Can't find 'test' module.</div>
1368+
<br /><br />
1369+
</div>
1370+
</div>
1371+
</body>
1372+
"
1373+
`;
1374+
1375+
exports[`overlay should show overlay when Trusted Types are enabled: page html 1`] = `
1376+
"<body>
1377+
<h1>webpack-dev-server is running...</h1>
1378+
<script type=\\"text/javascript\\" charset=\\"utf-8\\" src=\\"/main.js\\"></script>
1379+
1380+
<iframe
1381+
id=\\"webpack-dev-server-client-overlay\\"
1382+
src=\\"about:blank\\"
1383+
style=\\"
1384+
position: fixed;
1385+
inset: 0px;
1386+
width: 100vw;
1387+
height: 100vh;
1388+
border: none;
1389+
z-index: 2147483647;
1390+
\\"
1391+
></iframe>
1392+
</body>
1393+
"
1394+
`;

test/fixtures/static-config/public/node_modules/index.html

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/bin/cli-flags.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ declare const _exports: {
9191
simpleType: string;
9292
multiple: boolean;
9393
};
94+
"client-overlay-trusted-types-policy-name": {
95+
configs: {
96+
description: string;
97+
multiple: boolean;
98+
path: string;
99+
type: string;
100+
}[];
101+
description: string;
102+
multiple: boolean;
103+
simpleType: string;
104+
};
94105
"client-overlay-warnings": {
95106
configs: {
96107
type: string;

0 commit comments

Comments
 (0)