Skip to content

Commit 2360041

Browse files
committed
Tidy
1 parent 0784cd6 commit 2360041

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

test/plugs.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ tape('combined', function (t) {
8585
pull.collect(function (err, ary) {
8686
if(err) throw err
8787
t.equal(Buffer.concat(ary).toString(), 'HELLO WORLD')
88-
close(function() {t.end()})
88+
close(t.end)
8989
})
9090
)
9191
})
@@ -113,7 +113,7 @@ if (has_ipv6)
113113
pull.collect(function (err, ary) {
114114
if(err) throw err
115115
t.equal(Buffer.concat(ary).toString(), 'HELLO WORLD')
116-
close(function() {t.end()})
116+
close(t.end)
117117
})
118118
)
119119
})
@@ -165,7 +165,7 @@ tape('net: do not listen on all addresses', function (t) {
165165
console.log('addr local scope', addr)
166166
combined.client(addr, function (err, stream) {
167167
t.ok(err, 'should only listen on localhost')
168-
close(function() {t.end()})
168+
close(t.end)
169169
})
170170
})
171171

@@ -181,7 +181,7 @@ tape('net: do not crash if listen() fails', function(t) {
181181
var close = combined.server(echo, function() {}, function(err) {
182182
t.ok(err, 'should propagate listen error up')
183183
t.match(err.code, /^(ENOTFOUND|EAI_AGAIN)$/, 'the error is expected')
184-
close(function() {t.end()})
184+
close(() => t.end())
185185
})
186186
})
187187

@@ -220,9 +220,7 @@ tape('combined, unix', function (t) {
220220
pull.collect(function (err, ary) {
221221
if(err) throw err
222222
t.equal(Buffer.concat(ary).toString(), 'HELLO WORLD')
223-
close(function() {
224-
t.end()
225-
})
223+
close(t.end)
226224
})
227225
)
228226
})
@@ -234,7 +232,6 @@ tape('ws with combined', function (t) {
234232
t.ok(stream.address, 'has an address')
235233
echo(stream)
236234
}, null, function () {
237-
238235
combined_ws.client(combined_ws.stringify(), function (err, stream) {
239236
if(err) throw err
240237
t.ok(stream.address, 'has an address')
@@ -249,15 +246,14 @@ tape('ws with combined', function (t) {
249246
}),
250247
pull.collect(function (err, ary) {
251248
t.equal(Buffer.concat(ary).toString(), 'HELLO WORLD')
252-
close(function() {t.end()})
249+
close(t.end)
253250
})
254251
)
255252
})
256253
})
257254
})
258255

259256
tape('error if try to connect on wrong protocol', function (t) {
260-
261257
t.equal(combined_ws.parse(combined.stringify()), null)
262258

263259
combined_ws.client(combined.stringify(), function (err, stream) {
@@ -267,7 +263,6 @@ tape('error if try to connect on wrong protocol', function (t) {
267263
})
268264

269265
tape('shs with seed', function (t) {
270-
271266
var close = combined.server(echo)
272267

273268
var seed = cl.crypto_hash_sha256(Buffer.from('TEST SEED'))
@@ -288,9 +283,8 @@ tape('shs with seed', function (t) {
288283
t.notOk(err)
289284
t.deepEqual(checked, bob.publicKey)
290285
stream.source(true, function () {})
291-
close(function() {t.end()})
286+
close(t.end)
292287
})
293-
294288
})
295289

296290
tape('ws default port', function (t) {
@@ -338,7 +332,6 @@ tape('wss with key and cert', function (t) {
338332
var onion = Onion({scope: 'public'})
339333

340334
tape('onion plug', function (t) {
341-
342335
// onion has no server
343336
t.equal(onion.stringify('public'), null)
344337
t.equal(onion.stringify('device'), null)
@@ -357,7 +350,6 @@ tape('onion plug', function (t) {
357350

358351
//should not return an address
359352
t.notOk(oshs.stringify())
360-
361353
t.end()
362354
})
363355

@@ -384,7 +376,7 @@ tape('id of stream from server', function (t) {
384376
t.equal(addr[0].port, 4848)
385377
t.deepEqual(addr[1], combined.parse(combined.stringify())[1])
386378
stream.source(true, function () {
387-
close(function() {t.end()})
379+
close(t.end)
388380
})
389381
})
390382
})

0 commit comments

Comments
 (0)