11import { setup } from './setup' ;
22
3- describe ( 'util' , ( ) => {
4- describe ( 'ping' , ( ) => {
3+ describe ( 'util.* ' , ( ) => {
4+ describe ( 'util. ping' , ( ) => {
55 test ( 'returns pong' , async ( ) => {
66 const { caller} = setup ( ) ;
77 const res = await caller . call ( 'util.ping' , { } , { } ) ;
88 expect ( res . data ) . toBe ( 'pong' ) ;
99 } ) ;
1010 } ) ;
1111
12- describe ( 'echo' , ( ) => {
12+ describe ( 'util. echo' , ( ) => {
1313 test ( 'returns strings' , async ( ) => {
1414 const { caller} = setup ( ) ;
1515 const res = await caller . call ( 'util.echo' , 'hello world' , { } ) ;
@@ -22,4 +22,29 @@ describe('util', () => {
2222 expect ( res . data ) . toStrictEqual ( { foo : 'bar' } ) ;
2323 } ) ;
2424 } ) ;
25+
26+ describe ( 'util.info' , ( ) => {
27+ test ( 'returns stats object' , async ( ) => {
28+ const { call} = setup ( ) ;
29+ const res = await call ( 'util.info' , { } , { } ) ;
30+ expect ( res ) . toMatchObject ( {
31+ now : expect . any ( Number ) ,
32+ stats : {
33+ pubsub : {
34+ channels : expect . any ( Number ) ,
35+ observers : expect . any ( Number ) ,
36+ } ,
37+ presence : {
38+ rooms : expect . any ( Number ) ,
39+ entries : expect . any ( Number ) ,
40+ observers : expect . any ( Number ) ,
41+ } ,
42+ blocks : {
43+ blocks : expect . any ( Number ) ,
44+ patches : expect . any ( Number ) ,
45+ } ,
46+ } ,
47+ } ) ;
48+ } ) ;
49+ } ) ;
2550} ) ;
0 commit comments