@@ -3,15 +3,15 @@ import type { Daemon, DaemonFactory, NodeType, SpawnOptions, TransportType } fro
3
3
4
4
export function connectTests ( factory : DaemonFactory ) : void {
5
5
const nodeTypes : NodeType [ ] = [ 'js' , 'go' ]
6
- const transportTypes : TransportType [ ] = [ 'tcp' , 'webtransport' ]
6
+ const transportTypes : TransportType [ ] = [ 'tcp' , 'webtransport' , 'webrtc-direct' ]
7
7
8
8
for ( const typeA of nodeTypes ) {
9
9
for ( const typeB of nodeTypes ) {
10
10
transportTypes . forEach ( transport => {
11
11
runConnectTests (
12
12
transport ,
13
13
factory ,
14
- { type : typeA , transport } ,
14
+ { type : typeA , transport, noListen : true } ,
15
15
{ type : typeB , transport }
16
16
)
17
17
} )
@@ -23,13 +23,23 @@ function runConnectTests (name: string, factory: DaemonFactory, optionsA: SpawnO
23
23
describe ( `connection.${ name } ` , ( ) => {
24
24
let daemonA : Daemon
25
25
let daemonB : Daemon
26
+ let skipped : boolean
26
27
27
28
// Start Daemons
28
29
before ( async function ( ) {
29
30
this . timeout ( 20 * 1000 )
30
31
31
- daemonA = await factory . spawn ( optionsA )
32
- daemonB = await factory . spawn ( optionsB )
32
+ try {
33
+ daemonA = await factory . spawn ( optionsA )
34
+ daemonB = await factory . spawn ( optionsB )
35
+ } catch ( err : any ) {
36
+ if ( err . name === 'UnsupportedError' ) {
37
+ skipped = true
38
+ return
39
+ }
40
+
41
+ throw err
42
+ }
33
43
} )
34
44
35
45
// Stop daemons
@@ -44,6 +54,10 @@ function runConnectTests (name: string, factory: DaemonFactory, optionsA: SpawnO
44
54
it ( `${ optionsA . type } peer to ${ optionsB . type } peer over ${ name } ` , async function ( ) {
45
55
this . timeout ( 10 * 1000 )
46
56
57
+ if ( skipped ) {
58
+ return this . skip ( )
59
+ }
60
+
47
61
const identify1 = await daemonA . client . identify ( )
48
62
const identify2 = await daemonB . client . identify ( )
49
63
0 commit comments