Skip to content

Commit 1ce649c

Browse files
committed
test: update
1 parent d627b88 commit 1ce649c

File tree

5 files changed

+5
-28
lines changed

5 files changed

+5
-28
lines changed

lib/Server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ class Server {
737737
this.sockWrite([connection], 'log-level', this.clientLogLevel);
738738
}
739739

740-
if (this.options.hot) {
740+
if (this.options.hot === true || this.options.hot === 'only') {
741741
this.sockWrite([connection], 'hot');
742742
}
743743

lib/utils/updateCompiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function updateCompiler(compiler, options) {
5757
});
5858

5959
// do not apply the plugin unless it didn't exist before.
60-
if (options.hot || options.hot === 'only') {
60+
if (options.hot === true || options.hot === 'only') {
6161
compilersWithoutHMR.forEach((compiler) => {
6262
// addDevServerEntrypoints above should have added the plugin
6363
// to the compiler options

test/e2e/TransportMode.test.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,27 @@ const {
88
initConsoleDelay,
99
awaitServerCloseDelay,
1010
} = require('../helpers/puppeteer-constants');
11-
const isWebpack5 = require('../helpers/isWebpack5');
1211

1312
describe('transportMode client', () => {
1413
const modes = [
1514
{
1615
title: 'sockjs',
1716
options: {
17+
hot: false,
1818
transportMode: 'sockjs',
1919
},
2020
},
2121
{
2222
title: 'ws',
2323
options: {
24+
hot: false,
2425
transportMode: 'ws',
2526
},
2627
},
2728
{
2829
title: 'custom client',
2930
options: {
31+
hot: false,
3032
transportMode: {
3133
server: 'sockjs',
3234
client: require.resolve(
@@ -78,16 +80,7 @@ describe('transportMode client', () => {
7880
res.splice(i, 1);
7981
}
8082
}
81-
82-
// TODO: delete this code when getting rid of webpack5
83-
if (isWebpack5) {
84-
const swap = res[0];
85-
res[0] = res[1];
86-
res[1] = swap;
87-
}
88-
8983
expect(res).toMatchSnapshot();
90-
9184
done();
9285
});
9386
});

test/e2e/__snapshots__/TransportMode.test.js.snap

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
exports[`transportMode client custom client on browser client logs correctly 1`] = `
44
Array [
5-
"[HMR] Waiting for update signal from WDS...",
65
"Hey.",
76
"open",
8-
"hot",
9-
"[WDS] Hot Module Replacement enabled.",
107
"liveReload",
118
"[WDS] Live Reloading enabled.",
129
"hash",
@@ -18,19 +15,15 @@ Array [
1815

1916
exports[`transportMode client sockjs on browser client logs correctly 1`] = `
2017
Array [
21-
"[HMR] Waiting for update signal from WDS...",
2218
"Hey.",
23-
"[WDS] Hot Module Replacement enabled.",
2419
"[WDS] Live Reloading enabled.",
2520
"[WDS] Disconnected!",
2621
]
2722
`;
2823

2924
exports[`transportMode client ws on browser client logs correctly 1`] = `
3025
Array [
31-
"[HMR] Waiting for update signal from WDS...",
3226
"Hey.",
33-
"[WDS] Hot Module Replacement enabled.",
3427
"[WDS] Live Reloading enabled.",
3528
"[WDS] Disconnected!",
3629
]

test/helpers/isWebpack5.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)