Skip to content

Commit

Permalink
fix(test helpers): Split on newlines sooner so it has to happen less.
Browse files Browse the repository at this point in the history
  • Loading branch information
jirwin committed Apr 6, 2015
1 parent 21a76d2 commit 460bad2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var MockIrcd = function(port, encoding, isSecure) {

this.server = connectionClass.createServer(options, function(c) {
c.on('data', function(data) {
var msg = data.toString(self.encoding);
self.incoming = self.incoming.concat(msg.split('\r\n'));
var msg = data.toString(self.encoding).split('\r\n').filter(function(m) { return m; });
self.incoming = self.incoming.concat(msg);
});

self.on('send', function(data) {
Expand All @@ -56,7 +56,7 @@ MockIrcd.prototype.close = function() {
};

MockIrcd.prototype.getIncomingMsgs = function() {
return this.incoming.filter(function(msg) { return msg; });
return this.incoming;
};

var fixtures = require('./data/fixtures');
Expand Down

0 comments on commit 460bad2

Please sign in to comment.