Skip to content

Commit

Permalink
test: Misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
simnalamburt committed Oct 8, 2024
1 parent 724db30 commit d1ea9b5
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion test/away.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "away"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('away', function (e) {
client.on('away', (e) => {
expect(e.nick).toStrictEqual('colinm')
expect(e.message).toStrictEqual('brb food time')
done()
Expand Down
2 changes: 1 addition & 1 deletion test/invite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "invite"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('invite', function (e) {
client.on('invite', (e) => {
expect(e.from).toStrictEqual('test')
expect(e.to).toStrictEqual('astranger')
expect(e.channel).toStrictEqual('#something')
Expand Down
2 changes: 1 addition & 1 deletion test/join.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "join"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('join', function (e) {
client.on('join', (e) => {
expect(e.nick).toStrictEqual('tjholowaychuk')
expect(e.channel).toStrictEqual('#express')
expect(e.hostmask.nick).toStrictEqual('tjholowaychuk')
Expand Down
2 changes: 1 addition & 1 deletion test/kick.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "kick"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('kick', function (e) {
client.on('kick', (e) => {
expect(e.nick).toStrictEqual('tjholowaychuk')
expect(e.client).toStrictEqual('tobi')
expect(e.channel).toStrictEqual('#express')
Expand Down
6 changes: 3 additions & 3 deletions test/names.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should respond with user names', () =>
var stream = new Stream()
var client = irc(stream)

client.names('#luna-lang', function (err, names) {
client.names('#luna-lang', (err, names) => {
if (err) return done(err)
expect(names).toStrictEqual([
{ name: 'owner', mode: '~' },
Expand Down Expand Up @@ -40,7 +40,7 @@ it('should emit "names"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('names', function (e) {
client.on('names', (e) => {
expect(e.channel).toStrictEqual('#luna-lang')
expect(e.names).toStrictEqual([
{ name: 'one', mode: '' },
Expand Down Expand Up @@ -70,7 +70,7 @@ it('should retain ~ / @ / % / +', () =>
var stream = new Stream()
var client = irc(stream)

client.on('names', function (e) {
client.on('names', (e) => {
expect(e.channel).toStrictEqual('##luna-lang')
expect(e.names).toStrictEqual([
{ name: 'owner', mode: '~' },
Expand Down
2 changes: 1 addition & 1 deletion test/nick.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "nick"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('nick', function (e) {
client.on('nick', (e) => {
expect(e.nick).toStrictEqual('colinm')
expect(e.new).toStrictEqual('cmilhench')
expect(e.hostmask.nick).toStrictEqual('colinm')
Expand Down
2 changes: 1 addition & 1 deletion test/notice.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ it('should emit "notice"', () =>
var client = irc(stream)
var n = 0

client.on('notice', function (e) {
client.on('notice', (e) => {
expect(e.from).toStrictEqual('NickServ')
expect(e.to).toStrictEqual('cmilhench')
expect(e.hostmask.nick).toStrictEqual('NickServ')
Expand Down
2 changes: 1 addition & 1 deletion test/part.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "part"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('part', function (e) {
client.on('part', (e) => {
expect(e.nick).toStrictEqual('tjholowaychuk')
expect(e.channels).toStrictEqual(['#express'])
expect(e.message).toStrictEqual('So long!')
Expand Down
2 changes: 1 addition & 1 deletion test/pong.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ it('should respond with PONG', () =>
irc(stream)
var n = 0

stream.on('data', function (chunk) {
stream.on('data', (chunk) => {
switch (n++) {
case 0:
expect(chunk).toStrictEqual('PING :rothfuss.freenode.net\r\n')
Expand Down
2 changes: 1 addition & 1 deletion test/privmsg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "message"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('message', function (e) {
client.on('message', (e) => {
expect(e.from).toStrictEqual('tobi')
expect(e.to).toStrictEqual('loki')
expect(e.message).toStrictEqual('Hello :)')
Expand Down
2 changes: 1 addition & 1 deletion test/quit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "quit"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('quit', function (e) {
client.on('quit', (e) => {
expect(e.nick).toStrictEqual('tobi')
expect(e.message).toStrictEqual('Remote host closed the connection')
expect(e.hostmask.nick).toStrictEqual('tobi')
Expand Down
2 changes: 1 addition & 1 deletion test/topic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should emit "topic"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('topic', function (e) {
client.on('topic', (e) => {
expect(e.nick).toStrictEqual('tobi')
expect(e.channel).toStrictEqual('#slate')
expect(e.topic).toStrictEqual('Slate 1.0 is out!')
Expand Down
2 changes: 1 addition & 1 deletion test/welcome.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ it('should emit "welcome"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('welcome', function (nick) {
client.on('welcome', (nick) => {
expect(nick).toStrictEqual('tobi')
done()
})
Expand Down
12 changes: 6 additions & 6 deletions test/whois.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ it('should respond with user info', () =>
var stream = new Stream()
var client = irc(stream)

client.whois('colinm', function (err, e) {
client.whois('colinm', (err, e) => {
if (err) return done(err)
expect(e.hostname).toStrictEqual('client.host.net')
expect(e.username).toStrictEqual('~colinm')
Expand Down Expand Up @@ -47,7 +47,7 @@ it('should emit "info"', () =>
var stream = new Stream()
var client = irc(stream)

client.on('whois', function (err, e) {
client.on('whois', (err, e) => {
expect(e.hostname).toStrictEqual('client.host.net')
expect(e.username).toStrictEqual('~colinm')
expect(e.realname).toStrictEqual('Colin Milhench')
Expand Down Expand Up @@ -85,7 +85,7 @@ it('should emit "info"', () =>

client.whois('colinm')

client.on('whois', function (err, e) {
client.on('whois', (err, e) => {
expect(e.hostname).toStrictEqual('client.host.net')
expect(e.username).toStrictEqual('~colinm')
expect(e.realname).toStrictEqual('Colin Milhench')
Expand Down Expand Up @@ -121,7 +121,7 @@ it('should err with No such nick/channel', () =>
var stream = new Stream()
var client = irc(stream)
client.whois('nonick')
client.on('whois', function (err, e) {
client.on('whois', (err, e) => {
expect(err).toStrictEqual('No such nick/channel')
done()
})
Expand All @@ -133,7 +133,7 @@ it('should err with No such server', () =>
new Promise((done) => {
var stream = new Stream()
var client = irc(stream)
client.whois('nonick', function (err, e) {
client.whois('nonick', (err, e) => {
expect(err).toStrictEqual('No such server')
done()
})
Expand All @@ -144,7 +144,7 @@ it('should err with Not enough parameters', () =>
new Promise((done) => {
var stream = new Stream()
var client = irc(stream)
client.on('whois', function (err, e) {
client.on('whois', (err, e) => {
expect(err).toStrictEqual('Not enough parameters')
done()
})
Expand Down
4 changes: 2 additions & 2 deletions test/write.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ it('should err when newline characters are given', () =>
'PRIVMSG #loki :Hello :)\r\nNewline :(',
'PRIVMSG #lock :Some servers accept \r as a line delimiter',
]
tests.forEach(function (msg) {
client.write(msg, function (err) {
tests.forEach((msg) => {
client.write(msg, (err) => {
expect(err).not.toBeNull()
cnt++
if (cnt >= tests.length) done()
Expand Down

0 comments on commit d1ea9b5

Please sign in to comment.