Prefer putting nested structures on new lines

Format arguments to have nested structures start on a new line instead
of inline to make it easier to see where the structures starts and what
structure it is.
This commit is contained in:
Hornwitser committed 2023-07-26 14:27:49 +02:00
1 parent cb21a63ac2
commit 156d517976
7 files changed
+130 -77

No files matched your search

+16 -8
View File
@@ -95,18 +95,26 @@ describe("lib/link/connectors", function() {
it("should call register on hello", function() {
let called = false;
testConnector.register = () => { called = true; };
testConnector._processHandshake(new libData.MessageHello(new libData.HelloData("test", {})));
testConnector._processHandshake(
new libData.MessageHello(
new libData.HelloData("test", {})
)
);
assert(called, "register was not called");
});
it("should emit connect on ready", async function() {
let result = events.once(testConnector, "connect");
testConnector._processHandshake(new libData.MessageReady(new libData.ReadyData(
new libData.Address(libData.Address.control, 1),
"x",
20,
10,
undefined
)));
testConnector._processHandshake(
new libData.MessageReady(
new libData.ReadyData(
new libData.Address(libData.Address.control, 1),
"x",
20,
10,
undefined
)
)
);
await result;
clearInterval(testConnector._heartbeatId);
});
+20 -11
View File
@@ -283,7 +283,10 @@ describe("lib/link/link", function() {
let request = testLink.send(new SimpleRequest());
let srcReq = new libData.Address(libData.Address.control, 1, 1);
testConnector.emit(
"message", new libData.MessageResponseError(1, dst, srcReq, new libData.ResponseError("Error"))
"message",
new libData.MessageResponseError(
1, dst, srcReq, new libData.ResponseError("Error")
)
);
await assert.rejects(
request,
@@ -345,11 +348,14 @@ describe("lib/link/link", function() {
let response = (await message)[0];
assert.deepEqual(
response,
new libData.MessageResponseError(1, src, dst, new libData.ResponseError(
"Request NumberRequest failed validation",
response.data.code,
response.data.stack,
))
new libData.MessageResponseError(
1, src, dst,
new libData.ResponseError(
"Request NumberRequest failed validation",
response.data.code,
response.data.stack,
)
)
);
});
it("should send response error on response validation failing", async function() {
@@ -360,11 +366,14 @@ describe("lib/link/link", function() {
let response = (await message)[0];
assert.deepEqual(
response,
new libData.MessageResponseError(1, src, dst, new libData.ResponseError(
"Response for request NumberRequest failed validation",
response.data.code,
response.data.stack,
))
new libData.MessageResponseError(
1, src, dst,
new libData.ResponseError(
"Response for request NumberRequest failed validation",
response.data.code,
response.data.stack,
)
)
);
});
it("should send value returned from request handler", async function() {