Use double quotes

Convert existing mix of double quotes and single quotes to only use
double quotes unless the string contains double quotes.
This commit is contained in:
Hornwitser committed 2020-06-17 20:53:18 +02:00
1 parent efd759bec5
commit 34aaeee354
48 files changed
+708 -712

No files matched your search

+12 -12
View File
@@ -1,8 +1,8 @@
const assert = require('assert').strict;
const events = require('events');
const assert = require("assert").strict;
const events = require("events");
const mock = require('../../mock');
const link = require('lib/link');
const mock = require("../../mock");
const link = require("lib/link");
describe("lib/link/connectors", function() {
@@ -33,7 +33,7 @@ describe("lib/link/connectors", function() {
});
describe("class WebSocketClientConnector", function() {
let testConnector = new link.WebSocketClientConnector('url', 1);
let testConnector = new link.WebSocketClientConnector("url", 1);
testConnector._socket = new mock.MockSocket();
describe(".register()", function() {
@@ -49,10 +49,10 @@ describe("lib/link/connectors", function() {
it("calls send on the socket", function() {
testConnector._state = "handshake";
testConnector._socket.sentMessages = [];
testConnector.sendHandshake('test', { test: true });
testConnector.sendHandshake("test", { test: true });
assert.deepEqual(
testConnector._socket.sentMessages.map(JSON.parse),
[{ seq: null, type: 'test', data: { test: true }}]
[{ seq: null, type: "test", data: { test: true }}]
);
});
});
@@ -61,10 +61,10 @@ describe("lib/link/connectors", function() {
it("calls send on the socket", function() {
testConnector._state = "connected";
testConnector._socket.sentMessages = [];
let seq = testConnector.send('test', { test: true });
let seq = testConnector.send("test", { test: true });
assert.deepEqual(
testConnector._socket.sentMessages.map(JSON.parse),
[{ seq, type: 'test', data: { test: true }}]
[{ seq, type: "test", data: { test: true }}]
);
});
});
@@ -86,13 +86,13 @@ describe("lib/link/connectors", function() {
it("should call register on hello", function() {
let called = false;
testConnector.register = () => { called = true; };
testConnector._processHandshake({ seq: 1, type: 'hello', data: { version: "test", plugins: {} }});
testConnector._processHandshake({ seq: 1, type: "hello", data: { version: "test", plugins: {} }});
assert(called, "register was not called");
});
it("should emit connect on ready", async function() {
let result = events.once(testConnector, "connect");
testConnector._processHandshake(
{ seq: 1, type: 'ready', data: { session_token: "x", heartbeat_interval: 10 }}
{ seq: 1, type: "ready", data: { session_token: "x", heartbeat_interval: 10 }}
);
await result;
clearInterval(testConnector._heartbeatId);
@@ -121,7 +121,7 @@ describe("lib/link/connectors", function() {
it("should emit message on message in connected state", async function() {
testConnector._socket.sentMessages = [];
testConnector._state = "connected";
let result = events.once(testConnector, 'message');
let result = events.once(testConnector, "message");
testConnector._socket.events.get("message")('{"message":true}');
assert.deepEqual(await result, [{ message: true }]);
});