girc
Version:
IRC Client library
23 lines (19 loc) • 920 B
JavaScript
/*jslint node: true, vars: true*/
/*global describe, it*/
;
describe('plugins/welcome.js', function () {
var stream = new (require('stream').PassThrough)();
var cmngr = new (require('../../lib/connectionManager'))({id: "test_plugin_welcome", nick: "testnick"}, stream);
var con = cmngr.getConnection('test_plugin_welcome');
stream.emit('connect');
describe('on RPL_WELCOME', function () {
it('should emit "welcome"', function (done) {
con.once('welcome', function (event) {
event.nick.should.equal('testnick');
event.message.should.equal('Welcome to the KeratNet IRC Network testnick!testuser@testhost.com');
done();
});
stream.write(':example.irc.net 001 testnick :Welcome to the KeratNet IRC Network testnick!testuser@testhost.com\r\n');
});
});
});