1
1
import { expect } from 'aegir/chai'
2
- import { runTests } from './utils/test-matrix.js'
3
- import type { Daemon , SpawnOptions , DaemonFactory } from './index.js'
2
+ import type { Daemon , DaemonFactory , NodeType , SpawnOptions , TransportType } from '../index.js'
4
3
5
4
export function connectTests ( factory : DaemonFactory ) : void {
6
- runTests ( 'connect' , runConnectTests , factory )
5
+ const nodeTypes : NodeType [ ] = [ 'js' , 'go' ]
6
+ const transportTypes : TransportType [ ] = [ 'tcp' , 'webtransport' ]
7
+
8
+ for ( const typeA of nodeTypes ) {
9
+ for ( const typeB of nodeTypes ) {
10
+ transportTypes . forEach ( transport => {
11
+ runConnectTests (
12
+ transport ,
13
+ factory ,
14
+ { type : typeA , transport } ,
15
+ { type : typeB , transport }
16
+ )
17
+ } )
18
+ }
19
+ }
7
20
}
8
21
9
22
function runConnectTests ( name : string , factory : DaemonFactory , optionsA : SpawnOptions , optionsB : SpawnOptions ) : void {
10
- describe ( name , ( ) => {
23
+ describe ( `connection. ${ name } ` , ( ) => {
11
24
let daemonA : Daemon
12
25
let daemonB : Daemon
13
26
@@ -28,7 +41,7 @@ function runConnectTests (name: string, factory: DaemonFactory, optionsA: SpawnO
28
41
)
29
42
} )
30
43
31
- it ( `${ optionsA . type } peer to ${ optionsB . type } peer` , async function ( ) {
44
+ it ( `${ optionsA . type } peer to ${ optionsB . type } peer over ${ name } ` , async function ( ) {
32
45
this . timeout ( 10 * 1000 )
33
46
34
47
const identify1 = await daemonA . client . identify ( )
0 commit comments