git.schokokeks.org
Repositories
Help
Report an Issue
wirc-backend.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
c972b0c
Branches
Tags
master
wirc-backend.git
lib
node
node_modules
irc
test
test-double-crlf.js
[ini]
Christian Fraß
commited
c972b0c
at 2021-11-18 23:53:54
test-double-crlf.js
Blame
History
Raw
var net = require('net'); var irc = require('../lib/irc'); var test = require('tape'); var testHelpers = require('./helpers'); test('sent messages ending with double CRLF', function(t) { var mock = testHelpers.MockIrcd(); var client = new irc.Client('localhost', 'testbot', { debug: true}); var expected = testHelpers.getFixtures('double-CRLF'); t.plan(expected.sent.length + expected.received.length); mock.server.on('connection', function() { mock.send(expected.received[0][0]); }); client.on('registered', function() { t.equal(mock.outgoing[0], expected.received[0][0], expected.received[0][1]); client.disconnect(); }); mock.on('end', function() { var msgs = mock.getIncomingMsgs(); for (var i = 0; i < msgs.length; i++) { t.equal(msgs[i], expected.sent[i][0], expected.sent[i][1]); } mock.close(); }); });