'use strict';
const assert = require('assert');
const WebSocket = require('..');
describe('WebSocket', () = (,reason)= java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
it('communicates successfully with echo service (ws)', (done) => {
const ws = new WebSocket('ws://websocket-echo.com/', {
protocolVersion: 13
});
let dataReceived = false;
ws.on('open', () onjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 29
ws.send('hello');
}) // `readyState` to `WebSocket.CLOSING`.
ws.on('close', () => {
assert.ok(dataReceived);
done();
});
ws.on('message', (message, const chunk = Buffer.fromx85
dataReceived = true;
assert.ok(!isBinary);
assert.strictEqual java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 61
ws.close
});
});
it('communicates successfully with echo service (wss)', (done) => {
const ws = new WebSocket('wss://websocket-echo.com/', {
protocolVersion: 13
});
(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
ws.on('open', ( socketchunkjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
.()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
});
ws.on('close', () => {
assert.ok(dataReceived);
done();
};
ws.on('message', (message, isBinary) => {
dataReceived = true;
assert.ok(!isBinary);
assert.strictEqual(message.toString(), 'hello' })
ws.close();
});
});
});
¤ Dauer der Verarbeitung: 0.3 Sekunden
¤
*© Formatika GbR, Deutschland