Skip to content

Commit d1ea9b5

Browse files
committedOct 8, 2024··
test: Misc changes
1 parent 724db30 commit d1ea9b5

15 files changed

+23
-23
lines changed
 

‎test/away.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "away"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('away', function (e) {
11+
client.on('away', (e) => {
1212
expect(e.nick).toStrictEqual('colinm')
1313
expect(e.message).toStrictEqual('brb food time')
1414
done()

‎test/invite.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "invite"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('invite', function (e) {
11+
client.on('invite', (e) => {
1212
expect(e.from).toStrictEqual('test')
1313
expect(e.to).toStrictEqual('astranger')
1414
expect(e.channel).toStrictEqual('#something')

‎test/join.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "join"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('join', function (e) {
11+
client.on('join', (e) => {
1212
expect(e.nick).toStrictEqual('tjholowaychuk')
1313
expect(e.channel).toStrictEqual('#express')
1414
expect(e.hostmask.nick).toStrictEqual('tjholowaychuk')

‎test/kick.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "kick"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('kick', function (e) {
11+
client.on('kick', (e) => {
1212
expect(e.nick).toStrictEqual('tjholowaychuk')
1313
expect(e.client).toStrictEqual('tobi')
1414
expect(e.channel).toStrictEqual('#express')

‎test/names.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should respond with user names', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

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

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

73-
client.on('names', function (e) {
73+
client.on('names', (e) => {
7474
expect(e.channel).toStrictEqual('##luna-lang')
7575
expect(e.names).toStrictEqual([
7676
{ name: 'owner', mode: '~' },

‎test/nick.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "nick"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('nick', function (e) {
11+
client.on('nick', (e) => {
1212
expect(e.nick).toStrictEqual('colinm')
1313
expect(e.new).toStrictEqual('cmilhench')
1414
expect(e.hostmask.nick).toStrictEqual('colinm')

‎test/notice.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ it('should emit "notice"', () =>
99
var client = irc(stream)
1010
var n = 0
1111

12-
client.on('notice', function (e) {
12+
client.on('notice', (e) => {
1313
expect(e.from).toStrictEqual('NickServ')
1414
expect(e.to).toStrictEqual('cmilhench')
1515
expect(e.hostmask.nick).toStrictEqual('NickServ')

‎test/part.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "part"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('part', function (e) {
11+
client.on('part', (e) => {
1212
expect(e.nick).toStrictEqual('tjholowaychuk')
1313
expect(e.channels).toStrictEqual(['#express'])
1414
expect(e.message).toStrictEqual('So long!')

‎test/pong.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ it('should respond with PONG', () =>
99
irc(stream)
1010
var n = 0
1111

12-
stream.on('data', function (chunk) {
12+
stream.on('data', (chunk) => {
1313
switch (n++) {
1414
case 0:
1515
expect(chunk).toStrictEqual('PING :rothfuss.freenode.net\r\n')

‎test/privmsg.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "message"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('message', function (e) {
11+
client.on('message', (e) => {
1212
expect(e.from).toStrictEqual('tobi')
1313
expect(e.to).toStrictEqual('loki')
1414
expect(e.message).toStrictEqual('Hello :)')

‎test/quit.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "quit"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('quit', function (e) {
11+
client.on('quit', (e) => {
1212
expect(e.nick).toStrictEqual('tobi')
1313
expect(e.message).toStrictEqual('Remote host closed the connection')
1414
expect(e.hostmask.nick).toStrictEqual('tobi')

‎test/topic.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should emit "topic"', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.on('topic', function (e) {
11+
client.on('topic', (e) => {
1212
expect(e.nick).toStrictEqual('tobi')
1313
expect(e.channel).toStrictEqual('#slate')
1414
expect(e.topic).toStrictEqual('Slate 1.0 is out!')

‎test/welcome.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ it('should emit "welcome"', () =>
1919
var stream = new Stream()
2020
var client = irc(stream)
2121

22-
client.on('welcome', function (nick) {
22+
client.on('welcome', (nick) => {
2323
expect(nick).toStrictEqual('tobi')
2424
done()
2525
})

‎test/whois.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ it('should respond with user info', () =>
88
var stream = new Stream()
99
var client = irc(stream)
1010

11-
client.whois('colinm', function (err, e) {
11+
client.whois('colinm', (err, e) => {
1212
if (err) return done(err)
1313
expect(e.hostname).toStrictEqual('client.host.net')
1414
expect(e.username).toStrictEqual('~colinm')
@@ -47,7 +47,7 @@ it('should emit "info"', () =>
4747
var stream = new Stream()
4848
var client = irc(stream)
4949

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

8686
client.whois('colinm')
8787

88-
client.on('whois', function (err, e) {
88+
client.on('whois', (err, e) => {
8989
expect(e.hostname).toStrictEqual('client.host.net')
9090
expect(e.username).toStrictEqual('~colinm')
9191
expect(e.realname).toStrictEqual('Colin Milhench')
@@ -121,7 +121,7 @@ it('should err with No such nick/channel', () =>
121121
var stream = new Stream()
122122
var client = irc(stream)
123123
client.whois('nonick')
124-
client.on('whois', function (err, e) {
124+
client.on('whois', (err, e) => {
125125
expect(err).toStrictEqual('No such nick/channel')
126126
done()
127127
})
@@ -133,7 +133,7 @@ it('should err with No such server', () =>
133133
new Promise((done) => {
134134
var stream = new Stream()
135135
var client = irc(stream)
136-
client.whois('nonick', function (err, e) {
136+
client.whois('nonick', (err, e) => {
137137
expect(err).toStrictEqual('No such server')
138138
done()
139139
})
@@ -144,7 +144,7 @@ it('should err with Not enough parameters', () =>
144144
new Promise((done) => {
145145
var stream = new Stream()
146146
var client = irc(stream)
147-
client.on('whois', function (err, e) {
147+
client.on('whois', (err, e) => {
148148
expect(err).toStrictEqual('Not enough parameters')
149149
done()
150150
})

‎test/write.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ it('should err when newline characters are given', () =>
1414
'PRIVMSG #loki :Hello :)\r\nNewline :(',
1515
'PRIVMSG #lock :Some servers accept \r as a line delimiter',
1616
]
17-
tests.forEach(function (msg) {
18-
client.write(msg, function (err) {
17+
tests.forEach((msg) => {
18+
client.write(msg, (err) => {
1919
expect(err).not.toBeNull()
2020
cnt++
2121
if (cnt >= tests.length) done()

0 commit comments

Comments
 (0)
Please sign in to comment.