Skip to content

Commit

Permalink
added unit test for network error emission
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj1335 committed May 12, 2014
1 parent a7cbd5c commit 0a6b471
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/lib/irc.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,5 +427,18 @@ describe("irc", function() {
"NOTICE AUTH 11\r\nNOTICE AUTH 12\r\nNOTICE AUTH 13\r\nNOTICE AUTH 14\r\nNOTICE AUTH 15\r\n" +
"NOTICE AUTH 16\r\nNOTICE AUTH 17\r\nNOTICE AUTH 18\r\nNOTICE AUTH 19\r\nNOTICE AUTH 20\r\n");
});

bit("should forward errors to client", function(done) {
const bot = this;
let got = 0;
bot.match(cs.EVENT.ERROR, function() {
got++;
done();
});
bot.socket.emit("error");
setTimeout(function() {
got.should.equal(1);
}, 0);
});
});
});

0 comments on commit 0a6b471

Please sign in to comment.