Sheogorath
5 years ago
No known key found for this signature in database
GPG Key ID: 1F05CC3635CDDFFD
1 changed files with
23 additions and
0 deletions
-
test/command_pass.js
|
@ -29,6 +29,29 @@ describe("PASS OK", function () { |
|
|
user = server.getUserlist()["some_nick"] |
|
|
user = server.getUserlist()["some_nick"] |
|
|
assert.equal(user["registered"], true) |
|
|
assert.equal(user["registered"], true) |
|
|
done() |
|
|
done() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
it("should end connection on wrong password", function (done) { |
|
|
|
|
|
const server = IRCServer.create({ |
|
|
|
|
|
password: "itsJustATest" |
|
|
|
|
|
}) |
|
|
|
|
|
let mockedSock = new EventEmitter() |
|
|
|
|
|
|
|
|
|
|
|
mockedSock.address = function() { |
|
|
|
|
|
return { port: 12346, family: 'IPv4', address: '127.0.0.1' } |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mockedSock.write = function (data) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mockedSock.destroy = function () { |
|
|
|
|
|
// connection has to be destroyed
|
|
|
|
|
|
done("") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
server.emit("connection", mockedSock) |
|
|
|
|
|
mockedSock.emit('data', Buffer.from("PASS wrongpassword\r\n", "ascii")) |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |