@@ -4,36 +4,47 @@ import Echo from "../src/echo";
44
55describe ( "Echo" , ( ) => {
66 test ( "it will not throw error for supported driver" , ( ) => {
7- expect ( ( ) => new Echo ( { broadcaster : "reverb" } ) ) . not . toThrow (
8- "Broadcaster string reverb is not supported." ,
9- ) ;
7+ expect (
8+ ( ) =>
9+ new Echo ( { broadcaster : "reverb" , withoutInterceptors : true } ) ,
10+ ) . not . toThrow ( "Broadcaster string reverb is not supported." ) ;
1011
11- expect ( ( ) => new Echo ( { broadcaster : "pusher" } ) ) . not . toThrow (
12- "Broadcaster string pusher is not supported." ,
13- ) ;
12+ expect (
13+ ( ) =>
14+ new Echo ( { broadcaster : "pusher" , withoutInterceptors : true } ) ,
15+ ) . not . toThrow ( "Broadcaster string pusher is not supported." ) ;
1416
15- expect ( ( ) => new Echo ( { broadcaster : "socket.io" } ) ) . not . toThrow (
16- "Broadcaster string socket.io is not supported." ,
17- ) ;
17+ expect (
18+ ( ) =>
19+ new Echo ( {
20+ broadcaster : "socket.io" ,
21+ withoutInterceptors : true ,
22+ } ) ,
23+ ) . not . toThrow ( "Broadcaster string socket.io is not supported." ) ;
1824
19- expect ( ( ) => new Echo ( { broadcaster : "null" } ) ) . not . toThrow (
20- "Broadcaster string null is not supported." ,
21- ) ;
22- expect ( ( ) => new Echo ( { broadcaster : NullConnector } ) ) . not . toThrow ( ) ;
23-
24- // eslint-disable-next-line
25- // @ts -ignore
26- // eslint-disable-next-line @typescript-eslint/no-empty-function
27- expect ( ( ) => new Echo ( { broadcaster : ( ) => { } } ) ) . not . toThrow (
28- "Broadcaster function is not supported." ,
29- ) ;
25+ expect (
26+ ( ) => new Echo ( { broadcaster : "null" , withoutInterceptors : true } ) ,
27+ ) . not . toThrow ( "Broadcaster string null is not supported." ) ;
28+ expect (
29+ ( ) =>
30+ new Echo ( {
31+ broadcaster : NullConnector ,
32+ withoutInterceptors : true ,
33+ } ) ,
34+ ) . not . toThrow ( ) ;
35+ expect (
36+ ( ) =>
37+ // @ts -ignore
38+ // eslint-disable-next-line @typescript-eslint/no-empty-function
39+ new Echo ( { broadcaster : ( ) => { } , withoutInterceptors : true } ) ,
40+ ) . not . toThrow ( "Broadcaster function is not supported." ) ;
3041 } ) ;
3142
3243 test ( "it will throw error for unsupported driver" , ( ) => {
33- // eslint-disable-next-line
34- // @ts -ignore
35- expect ( ( ) => new Echo ( { broadcaster : "foo" } ) ) . toThrow (
36- "Broadcaster string foo is not supported." ,
37- ) ;
44+ expect (
45+ // @ts -ignore
46+ // eslint-disable-next-line
47+ ( ) => new Echo ( { broadcaster : "foo" , withoutInterceptors : true } ) ,
48+ ) . toThrow ( "Broadcaster string foo is not supported." ) ;
3849 } ) ;
3950} ) ;
0 commit comments