refactor tests for readability + linting fixes

This commit is contained in:
Enrique Hernandez 2021-02-10 23:04:53 -06:00
commit 57fce6d6cc
12 changed files with 123 additions and 318 deletions

View file

@ -1,29 +0,0 @@
const WebSocket = require("ws");
const testMessage = {
content: 'Hello from test server!' ,
context: 'test message',
subContext: '',
modifiers: 'ai',
id: "0",
time: 'test'
}
const wss = new WebSocket.Server({
port: 8081
});
wss.on("connection", function connection(ws, req) {
ws.on("message", function incoming(message) {
console.log(message)
if (message === 'no-token' || message === 'undefined') {
console.log('no token to authenticate');
ws.send('locked');
}
});
const ip = req.socket.remoteAddress;
console.log("received connection from", ip);
// ws.send(JSON.stringify(testMessage));
});