Fix formatting

This commit is contained in:
Felipe Knorr Kuhn 2021-12-14 23:15:33 -08:00
parent 4bc141cd67
commit bc7bbf5fe5
No known key found for this signature in database
GPG Key ID: 79619B52BB097C1A

View File

@ -31,19 +31,19 @@ export const mockWebSocket = () => {
cy.on('window:before:load', (win) => {
const winWebSocket = win.WebSocket;
cy.stub(win, 'WebSocket').callsFake((url) => {
console.log(url);
console.log(url);
if ((new URL(url).pathname.indexOf('/sockjs-node/') !== 0)) {
const { server, websocket } = createMock(url);
win.mockServer = server;
win.mockServer.on('connection', (socket) => {
win.mockSocket = socket;
win.mockSocket.send('{"action":"init"}');
win.mockSocket.send('{"action":"init"}');
});
win.mockServer.on('message', (message) => {
console.log(message);
});
win.mockServer.on('message', (message) => {
console.log(message);
});
return websocket;
} else {
@ -89,4 +89,4 @@ export const dropWebSocket = (() => {
win.mockServer.simulate("error");
});
return cy.wait(500);
});
});