Skip to content

Commit 9a18dc3

Browse files
committed
autoformat WebSocket tests
1 parent 7b7eddf commit 9a18dc3

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

javascript/ql/test/library-tests/frameworks/WebSocket/browser.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
const socket = new WebSocket('ws://localhost:8080');
33

44
socket.addEventListener('open', function (event) {
5-
socket.send('Hi from browser!');
5+
socket.send('Hi from browser!');
66
});
77

88
socket.addEventListener('message', function (event) {
9-
console.log('Message from server ', event.data);
9+
console.log('Message from server ', event.data);
1010
});
11-
12-
socket.onmessage = function(event) {
13-
console.log("Message from server 2", event.data)
14-
};
11+
12+
socket.onmessage = function (event) {
13+
console.log("Message from server 2", event.data)
14+
};
1515
})();

javascript/ql/test/library-tests/frameworks/WebSocket/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
const ws = new WebSocket('ws://example.org');
55

66
ws.on('open', function open() {
7-
ws.send('Hi from client!');
7+
ws.send('Hi from client!');
88
});
99

1010
ws.on('message', function incoming(data) {
11-
console.log(data);
11+
console.log(data);
1212
});
1313
})();

javascript/ql/test/library-tests/frameworks/WebSocket/server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
const wss = new WebSocket.Server({ port: 8080 });
55

66
wss.on('connection', function connection(ws) {
7-
ws.on('message', function incoming(message) {
8-
console.log('received: %s', message);
9-
});
7+
ws.on('message', function incoming(message) {
8+
console.log('received: %s', message);
9+
});
1010

11-
ws.send('Hi from server!');
11+
ws.send('Hi from server!');
1212
});
1313
})();

javascript/ql/test/library-tests/frameworks/WebSocket/sockjs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const sockjs = require('sockjs');
55
const app = express();
66
const server = http.createServer(app);
77
const sockjs_echo = sockjs.createServer({});
8-
sockjs_echo.on('connection', function(conn) {
9-
conn.on('data', function(message) {
8+
sockjs_echo.on('connection', function (conn) {
9+
conn.on('data', function (message) {
1010
var data = JSON.parse(message);
1111
conn.write(JSON.stringify(eval(data.test)));
1212
});
1313
});
1414

15-
sockjs_echo.installHandlers(server, {prefix:'/echo'});
15+
sockjs_echo.installHandlers(server, { prefix: '/echo' });
1616
server.listen(9090, '127.0.0.1');

javascript/ql/test/library-tests/frameworks/WebSocket/test.expected

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ clientSocket
22
| browser.js:2:17:2:52 | new Web ... :8080') |
33
| client.js:4:13:4:45 | new Web ... e.org') |
44
clientSend
5-
| browser.js:5:6:5:36 | socket. ... wser!') |
6-
| client.js:7:5:7:30 | ws.send ... ient!') |
5+
| browser.js:5:3:5:33 | socket. ... wser!') |
6+
| client.js:7:3:7:28 | ws.send ... ient!') |
77
clientReceive
88
| browser.js:8:37:10:2 | functio ... ta);\\n\\t} |
9-
| browser.js:12:21:14:5 | functio ... )\\n } |
9+
| browser.js:12:21:14:2 | functio ... ata)\\n\\t} |
1010
| client.js:10:19:12:2 | functio ... ta);\\n\\t} |
1111
serverSocket
1212
| server.js:6:43:6:44 | ws |
1313
serverSend
14-
| server.js:11:5:11:30 | ws.send ... rver!') |
14+
| server.js:11:3:11:28 | ws.send ... rver!') |
1515
serverReceive
16-
| server.js:7:5:9:6 | ws.on(' ... \\n \\t\\t}) |
16+
| server.js:7:3:9:4 | ws.on(' ... );\\n\\t\\t}) |
1717
taintStep
18-
| browser.js:5:18:5:35 | 'Hi from browser!' | server.js:7:40:7:46 | message |
19-
| client.js:7:13:7:29 | 'Hi from client!' | server.js:7:40:7:46 | message |
20-
| server.js:11:13:11:29 | 'Hi from server!' | browser.js:9:42:9:51 | event.data |
21-
| server.js:11:13:11:29 | 'Hi from server!' | browser.js:13:44:13:53 | event.data |
22-
| server.js:11:13:11:29 | 'Hi from server!' | client.js:10:37:10:40 | data |
18+
| browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message |
19+
| client.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message |
20+
| server.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data |
21+
| server.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data |
22+
| server.js:11:11:11:27 | 'Hi from server!' | client.js:10:37:10:40 | data |

0 commit comments

Comments
 (0)