@@ -22,7 +22,7 @@ import type { PeerStore, Peer } from '@libp2p/interface/peer-store'
22
22
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
23
23
24
24
describe ( 'auto-dial' , ( ) => {
25
- let autoDialler : AutoDial
25
+ let autoDialer : AutoDial
26
26
let events : EventEmitter < Libp2pEvents >
27
27
let peerStore : PeerStore
28
28
let peerId : PeerId
@@ -38,8 +38,8 @@ describe('auto-dial', () => {
38
38
} )
39
39
40
40
afterEach ( ( ) => {
41
- if ( autoDialler != null ) {
42
- autoDialler . stop ( )
41
+ if ( autoDialer != null ) {
42
+ autoDialer . stop ( )
43
43
}
44
44
} )
45
45
@@ -73,16 +73,16 @@ describe('auto-dial', () => {
73
73
getDialQueue : [ ]
74
74
} )
75
75
76
- autoDialler = new AutoDial ( {
76
+ autoDialer = new AutoDial ( {
77
77
peerStore,
78
78
connectionManager,
79
79
events
80
80
} , {
81
81
minConnections : 10 ,
82
82
autoDialInterval : 10000
83
83
} )
84
- autoDialler . start ( )
85
- void autoDialler . autoDial ( )
84
+ autoDialer . start ( )
85
+ void autoDialer . autoDial ( )
86
86
87
87
await pWaitFor ( ( ) => {
88
88
return connectionManager . openConnection . callCount === 1
@@ -127,15 +127,15 @@ describe('auto-dial', () => {
127
127
getDialQueue : [ ]
128
128
} )
129
129
130
- autoDialler = new AutoDial ( {
130
+ autoDialer = new AutoDial ( {
131
131
peerStore,
132
132
connectionManager,
133
133
events
134
134
} , {
135
135
minConnections : 10
136
136
} )
137
- autoDialler . start ( )
138
- await autoDialler . autoDial ( )
137
+ autoDialer . start ( )
138
+ await autoDialer . autoDial ( )
139
139
140
140
await pWaitFor ( ( ) => connectionManager . openConnection . callCount === 1 )
141
141
await delay ( 1000 )
@@ -181,15 +181,15 @@ describe('auto-dial', () => {
181
181
} ]
182
182
} )
183
183
184
- autoDialler = new AutoDial ( {
184
+ autoDialer = new AutoDial ( {
185
185
peerStore,
186
186
connectionManager,
187
187
events
188
188
} , {
189
189
minConnections : 10
190
190
} )
191
- autoDialler . start ( )
192
- await autoDialler . autoDial ( )
191
+ autoDialer . start ( )
192
+ await autoDialer . autoDial ( )
193
193
194
194
await pWaitFor ( ( ) => connectionManager . openConnection . callCount === 1 )
195
195
await delay ( 1000 )
@@ -207,20 +207,20 @@ describe('auto-dial', () => {
207
207
getDialQueue : [ ]
208
208
} )
209
209
210
- autoDialler = new AutoDial ( {
210
+ autoDialer = new AutoDial ( {
211
211
peerStore,
212
212
connectionManager,
213
213
events
214
214
} , {
215
215
minConnections : 10 ,
216
216
autoDialInterval : 10000
217
217
} )
218
- autoDialler . start ( )
218
+ autoDialer . start ( )
219
219
220
220
// call autodial twice
221
221
await Promise . all ( [
222
- autoDialler . autoDial ( ) ,
223
- autoDialler . autoDial ( )
222
+ autoDialer . autoDial ( ) ,
223
+ autoDialer . autoDial ( )
224
224
] )
225
225
226
226
// should only have queried peer store once
@@ -258,17 +258,17 @@ describe('auto-dial', () => {
258
258
getDialQueue : [ ]
259
259
} )
260
260
261
- autoDialler = new AutoDial ( {
261
+ autoDialer = new AutoDial ( {
262
262
peerStore,
263
263
connectionManager,
264
264
events
265
265
} , {
266
266
minConnections : 10 ,
267
267
autoDialPeerRetryThreshold : 2000
268
268
} )
269
- autoDialler . start ( )
269
+ autoDialer . start ( )
270
270
271
- void autoDialler . autoDial ( )
271
+ void autoDialer . autoDial ( )
272
272
273
273
await pWaitFor ( ( ) => {
274
274
return connectionManager . openConnection . callCount === 1
@@ -282,7 +282,7 @@ describe('auto-dial', () => {
282
282
await delay ( 2000 )
283
283
284
284
// autodial again
285
- void autoDialler . autoDial ( )
285
+ void autoDialer . autoDial ( )
286
286
287
287
await pWaitFor ( ( ) => {
288
288
return connectionManager . openConnection . callCount === 3
0 commit comments