Skip to content

Commit

Permalink
Trying to destroy socket
Browse files Browse the repository at this point in the history
  • Loading branch information
dominusmars committed Mar 1, 2024
1 parent 205c17f commit 6cdcf33
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/ssh.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ for (let computer of computers) {
let socket: Channel = await ssh.shell();
let result = await sendCommandExpect(socket, `powershell.exe`, `> `);
assert.ok(result.includes("> "), "Didn't get expected output: " + result);
socket.end();
socket.close();
socket.destroy();
await ssh.close();
});
it("socketGetOutput", async () => {
Expand All @@ -148,7 +150,9 @@ for (let computer of computers) {
let socket: Channel = await ssh.shell();
let result = await socketGetOutput(socket, `powershell.exe`);
assert.ok(result.includes("> "), "Didn't get expected output: " + result);
socket.end();
socket.close();
socket.destroy();
await ssh.close();
});
it("sendCommandNoExpect", async () => {
Expand All @@ -161,7 +165,10 @@ for (let computer of computers) {
sendCommandNoExpect(socket, `hostname`, "Pineapples are great"),
"Unable to check for not expect output"
);
socket.end();
socket.close();
socket.destroy();

await ssh.close();
});
it("sendCommand", async () => {
Expand All @@ -172,7 +179,10 @@ for (let computer of computers) {
let socket: Channel = await ssh.shell();
let result = await sendCommand(socket, "echo hello");
assert.ok(result.includes("echo"), "Didn't get expected output: " + result);
socket.end();
socket.close();
socket.destroy();

await ssh.close();
});
});
Expand Down

0 comments on commit 6cdcf33

Please sign in to comment.