1
1
import { assertEquals } from "../deps.ts" ;
2
2
import { describe } from "../testing/helpers.ts" ;
3
3
import { mock } from "../testing/mock.ts" ;
4
+ import { nickPlugin } from "./nick.ts" ;
5
+ import { registerPlugin } from "./register.ts" ;
6
+ import { registrationPlugin } from "./registration.ts" ;
4
7
import { isupportPlugin } from "./isupport.ts" ;
5
8
import { namesPlugin } from "./names.ts" ;
6
9
7
10
describe ( "plugins/names" , ( test ) => {
8
- const plugins = [ isupportPlugin , namesPlugin ] ;
11
+ const plugins = [
12
+ nickPlugin ,
13
+ registerPlugin ,
14
+ registrationPlugin ,
15
+ isupportPlugin ,
16
+ namesPlugin ,
17
+ ] ;
18
+
19
+ const options = { nick : "me" } ;
9
20
10
21
test ( "send NAMES" , async ( ) => {
11
- const { client, server } = await mock ( plugins , { } ) ;
22
+ const { client, server } = await mock ( plugins , options ) ;
12
23
13
24
client . names ( "#channel" ) ;
14
25
client . names ( [ "#channel1" , "#channel2" ] ) ;
@@ -21,7 +32,7 @@ describe("plugins/names", (test) => {
21
32
} ) ;
22
33
23
34
test ( "emit 'names_reply' on RPL_ENDOFNAMES" , async ( ) => {
24
- const { client, server } = await mock ( plugins , { } ) ;
35
+ const { client, server } = await mock ( plugins , options ) ;
25
36
26
37
server . send ( [
27
38
":serverhost 353 me = #channel :%nick1 @+nick2 +nick3" ,
@@ -44,7 +55,7 @@ describe("plugins/names", (test) => {
44
55
} ) ;
45
56
46
57
test ( "emit 'names_reply' on RPL_ISUPPORT + RPL_ENDOFNAMES" , async ( ) => {
47
- const { client, server } = await mock ( plugins , { } ) ;
58
+ const { client, server } = await mock ( plugins , options ) ;
48
59
49
60
server . send (
50
61
":serverhost 005 nick PREFIX=(qaohv)~&@%+ :are supported by this server" ,
0 commit comments