Port message types to TypeScript

This commit is contained in:
Hornwitser committed 2023-08-11 00:24:00 +02:00
1 parent 15ea9a91dc
commit 2a52a82fb7
31 files changed
+2846 -4124

No files matched your search

+6 -4
View File
@@ -92,12 +92,14 @@ describe("Integration of Clusterio", function() {
describe("queryLogRequestHandler", function() {
it("should honnor the limit", async function() {
let result = await getControl().send(new lib.LogQueryRequest(true, false, [], [], null, 10, "asc"));
let result = await getControl().send(
new lib.LogQueryRequest(true, false, [], [], undefined, 10, "asc")
);
assert.equal(result.log.length, 10);
});
it("should return entries by order", async function() {
let first = await getControl().send(new lib.LogQueryRequest(true, false, [], [], null, 1, "asc"));
let last = await getControl().send(new lib.LogQueryRequest(true, false, [], [], null, 1, "desc"));
let first = await getControl().send(new lib.LogQueryRequest(true, false, [], [], undefined, 1, "asc"));
let last = await getControl().send(new lib.LogQueryRequest(true, false, [], [], undefined, 1, "desc"));
assert(first.log[0].timestamp < last.log[0].timestamp, "first log entry happened after last");
});
});
@@ -346,7 +348,7 @@ describe("Integration of Clusterio", function() {
slowTest(this);
await execCtl("instance send-rcon test technobabble");
let { log } = await getControl().send(
new lib.LogQueryRequest(false, false, [], [44], null, 10, "desc")
new lib.LogQueryRequest(false, false, [], [44], undefined, 10, "desc")
);
assert(log.some(info => /technobabble/.test(info.message)), "Command was not sent");
});
+1 -1
View File
@@ -19,7 +19,7 @@ describe("lib/command", function() {
lib.HostListRequest, () => [new lib.HostDetails("test", "0.1", "Test Host", 11, false)]
);
testController.handle(
lib.InstanceDetailsListRequest, () => [new lib.InstanceDetails("Test Instance", 57, 4, null, "stopped")]
lib.InstanceDetailsListRequest, () => [new lib.InstanceDetails("Test Instance", 57, 4, undefined, "stopped")]
);
testController.handle(lib.RoleListRequest, () => [testRole]);