Sheogorath
6 years ago
No known key found for this signature in database
GPG Key ID: 1F05CC3635CDDFFD
1 changed files with
0 additions and
28 deletions
-
test/command_quit.js
|
|
@ -1,28 +0,0 @@ |
|
|
|
const assert = require('assert'); |
|
|
|
const EventEmitter = require('events'); |
|
|
|
const IRCServer = require("../src/server.js"); |
|
|
|
|
|
|
|
describe("QUIT OK", function () { |
|
|
|
it("should handle a QUIT command -> QUIT quitmessage", function (done) { |
|
|
|
const server = IRCServer.create() |
|
|
|
|
|
|
|
for (var i = 0; i < 3; i++) { |
|
|
|
|
|
|
|
let mockedSock = new EventEmitter() |
|
|
|
|
|
|
|
mockedSock.write = function (data) { |
|
|
|
} |
|
|
|
|
|
|
|
server.emit('connection', mockedSock) |
|
|
|
mockedSock.emit('data', Buffer.from("NICK nick" + i + "\r\n", "ascii")) |
|
|
|
} |
|
|
|
|
|
|
|
mockedSock.quit("gone to have lunch") |
|
|
|
|
|
|
|
|
|
|
|
mockedSock.destroy = function () { |
|
|
|
done("Destroyed socket without answering") |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |