Skip to content

Commit

Permalink
Fix unit test for new closing behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickjuchli committed Oct 3, 2018
1 parent b7c2b4c commit f03f979
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/ftpContextSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ describe("FTPContext", function() {
ftp.send("HELLO 直己");
});

it("destroys sockets when closing", function() {
it("creates a new control socket when closing", function() {
const oldSocket = ftp.socket;
ftp.close();
assert(ftp.socket.destroyed, "Control socket");
assert(ftp.dataSocket.destroyed, "Data socket");
assert.notEqual(ftp.socket, oldSocket, "Control socket");
assert.equal(ftp.dataSocket, undefined, "Data socket");
});

it("reports whether socket has TLS", function() {
Expand Down

0 comments on commit f03f979

Please sign in to comment.