Skip to content

Commit 3ef1939

Browse files
test: fix
1 parent 078feb1 commit 3ef1939

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/e2e/web-socket-communication.test.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("web socket communication", () => {
3434

3535
page
3636
.on("console", (message) => {
37-
consoleMessages.push(message);
37+
consoleMessages.push(message.text());
3838
})
3939
.on("pageerror", (error) => {
4040
pageErrors.push(error);
@@ -46,20 +46,18 @@ describe("web socket communication", () => {
4646
await server.stop();
4747
await new Promise((resolve) => {
4848
const interval = setInterval(() => {
49-
if (server.webSocketServer.clients.size === 0) {
49+
if (consoleMessages.includes("[webpack-dev-server] Disconnected!")) {
5050
clearInterval(interval);
51+
5152
resolve();
5253
}
5354
}, 100);
5455
});
5556

56-
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
57-
"console messages"
58-
);
57+
expect(consoleMessages).toMatchSnapshot("console messages");
5958
expect(pageErrors).toMatchSnapshot("page errors");
6059

6160
await browser.close();
62-
await server.stop();
6361
});
6462

6563
it(`should work and terminate client that is not alive ("${websocketServer}")`, async () => {

0 commit comments

Comments
 (0)