File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const Packet = require('../packets/packet.js');
7
7
class Quit extends Command {
8
8
constructor ( callback ) {
9
9
super ( ) ;
10
- this . done = callback ;
10
+ this . onResult = callback ;
11
11
}
12
12
13
13
start ( packet , connection ) {
@@ -18,8 +18,8 @@ class Quit extends Command {
18
18
0 ,
19
19
5
20
20
) ;
21
- if ( this . done ) {
22
- this . done ( ) ;
21
+ if ( this . onResult ) {
22
+ this . onResult ( ) ;
23
23
}
24
24
connection . writePacket ( quit ) ;
25
25
return null ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ const assert = require ( 'assert' ) ;
4
+ const Quit = require ( '../../../lib/commands/quit' ) ;
5
+
6
+ const testCallback = err => console . info ( err . message ) ;
7
+ const testQuit = new Quit ( testCallback ) ;
8
+
9
+ assert . strictEqual ( testQuit . onResult , testCallback ) ;
You can’t perform that action at this time.
0 commit comments