Browse Source

Merge commit 'b0cd18967bd5075cf52a9c6ac4e3af5bb099ed61' into HEAD

feature/user
Jenkins 6 years ago
parent
commit
a9b3620195
  1. 8
      src/server.js
  2. 8
      test/command_create.js

8
src/server.js

@ -15,7 +15,7 @@ let server = {}
let registeredUserlist = require("../src/userlist.js")
server.create = function create() {
return net.createServer((socket) => {
let server = net.createServer((socket) => {
const user = new User(socket)
socket.on('data', function (data) {
let tokenized = data.toString("ascii").split("\r\n")[0].split(" ")
@ -54,6 +54,12 @@ server.create = function create() {
console.error(err);
throw err;
});
server.getUserlist = function() {
return registeredUserlist
}
return server
}

8
test/command_create.js

@ -9,4 +9,12 @@ describe('IRC server', function () {
assert.equal(server.eventNames().toString(), ["connection", "error"].toString())
})
})
describe('#getUserlist()', function () {
it("should return a socket server", function () {
const server = IRCServer.create()
assert.equal(server.getUserlist().toString(), {}.toString())
})
})
})
Loading…
Cancel
Save