@@ -11,7 +11,7 @@ import { NimGoNode } from "../src/node/node.js";
11
11
12
12
chai . use ( chaiAsPromised ) ;
13
13
14
- describe ( "Metadata Protocol" , ( ) => {
14
+ describe . only ( "Metadata Protocol" , ( ) => {
15
15
let waku : LightNode ;
16
16
let nwaku1 : NimGoNode ;
17
17
@@ -52,6 +52,9 @@ describe("Metadata Protocol", () => {
52
52
expect ( shardInfoRes ) . to . not . be . undefined ;
53
53
expect ( shardInfoRes ?. clusterId ) . to . equal ( shardInfo . clusterId ) ;
54
54
expect ( shardInfoRes ?. shards ) . to . deep . equal ( shardInfo . shards ) ;
55
+
56
+ const activeConnections = waku . libp2p . getConnections ( ) ;
57
+ expect ( activeConnections . length ) . to . equal ( 1 ) ;
55
58
} ) ;
56
59
57
60
it ( "same cluster, different shard: nodes connect" , async function ( ) {
@@ -87,6 +90,9 @@ describe("Metadata Protocol", () => {
87
90
expect ( shardInfoRes ) . to . not . be . undefined ;
88
91
expect ( shardInfoRes ?. clusterId ) . to . equal ( shardInfo1 . clusterId ) ;
89
92
expect ( shardInfoRes ?. shards ) . to . deep . equal ( shardInfo1 . shards ) ;
93
+
94
+ const activeConnections = waku . libp2p . getConnections ( ) ;
95
+ expect ( activeConnections . length ) . to . equal ( 1 ) ;
90
96
} ) ;
91
97
92
98
it ( "different cluster, same shard: nodes don't connect" , async function ( ) {
@@ -120,6 +126,9 @@ describe("Metadata Protocol", () => {
120
126
await expect (
121
127
waku . libp2p . services . metadata ?. query ( nwaku1PeerId )
122
128
) . to . be . rejectedWith ( "the connection is being closed" ) ;
129
+
130
+ const activeConnections = waku . libp2p . getConnections ( ) ;
131
+ expect ( activeConnections . length ) . to . equal ( 0 ) ;
123
132
} ) ;
124
133
125
134
it ( "different cluster, different shard: nodes don't connect" , async function ( ) {
@@ -153,5 +162,8 @@ describe("Metadata Protocol", () => {
153
162
await expect (
154
163
waku . libp2p . services . metadata ?. query ( nwaku1PeerId )
155
164
) . to . be . rejectedWith ( "the connection is being closed" ) ;
165
+
166
+ const activeConnections = waku . libp2p . getConnections ( ) ;
167
+ expect ( activeConnections . length ) . to . equal ( 0 ) ;
156
168
} ) ;
157
169
} ) ;
0 commit comments