Skip to content

Commit

Permalink
fix lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jirwin committed Nov 26, 2016
1 parent 7b3fed3 commit e4000b7
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions test/test-quit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ var test = require('tape');
var testHelpers = require('./helpers');

test('connect and quit with message', function(t) {
var client, mock, expected;
var client, mock, expected;

mock = testHelpers.MockIrcd();
client = new irc.Client('localhost', 'testbot', {debug: true});
mock = testHelpers.MockIrcd();
client = new irc.Client('localhost', 'testbot', {debug: true});

expected = testHelpers.getFixtures('quit');
expected = testHelpers.getFixtures('quit');

t.plan(expected.sent.length + expected.received.length + 1);
t.plan(expected.sent.length + expected.received.length + 1);

mock.server.on('connection', function() {
mock.send(':localhost 001 testbot :Welcome to the Internet Relay Chat Network testbot\r\n');
});
mock.server.on('connection', function() {
mock.send(':localhost 001 testbot :Welcome to the Internet Relay Chat Network testbot\r\n');
});

client.on('registered', function() {
t.equal(mock.outgoing[0], expected.received[0][0], expected.received[0][1]);
client.disconnect('quitting as a test', function() {});
});
client.on('registered', function() {
t.equal(mock.outgoing[0], expected.received[0][0], expected.received[0][1]);
client.disconnect('quitting as a test', function() {});
});

mock.on('end', function() {
var msgs = mock.getIncomingMsgs();
mock.on('end', function() {
var msgs = mock.getIncomingMsgs();

t.equal(msgs.length, expected.sent.length, 'Server received the correct amount of messages.')
t.equal(msgs.length, expected.sent.length, 'Server received the correct amount of messages.')

for (var i = 0; i < msgs.length; i++) {
t.equal(msgs[i], expected.sent[i][0], expected.sent[i][1]);
}
mock.close();
});
for (var i = 0; i < msgs.length; i++) {
t.equal(msgs[i], expected.sent[i][0], expected.sent[i][1]);
}
mock.close();
});
});

0 comments on commit e4000b7

Please sign in to comment.