mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
fix: plugin sdk 1.0.5 with optional ui peers, safer timeouts and validate checks
This commit is contained in:
1 parent
af09aa1028
commit
b0a0ee3e00
10 files changed
+113
-12
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
isValidPackageName,
|
||||
buildSudoCommand,
|
||||
parseUpgradable,
|
||||
execCommand,
|
||||
} from "@termix-ssh/plugin-sdk/host-commands";
|
||||
|
||||
describe("parsePlatformProbe", () => {
|
||||
@@ -114,3 +115,13 @@ describe("parseUpgradable", () => {
|
||||
expect(parseUpgradable(null, "anything")).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("execCommand", () => {
|
||||
it("leaves the command out of the timeout error", async () => {
|
||||
const client = { exec: () => {} } as never;
|
||||
const command = buildSudoCommand("apt update", "hunter2");
|
||||
await expect(execCommand(client, command, 5)).rejects.toThrow(
|
||||
/^Command timeout after 5ms$/,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user