Skip to content

Commit

Permalink
test: add test for webrtc-direct
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Aug 6, 2024
1 parent 88f0b89 commit 20c87c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/identify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
tls "github.com/libp2p/go-libp2p/p2p/security/tls"
quic "github.com/libp2p/go-libp2p/p2p/transport/quic"
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
libp2pwebrtc "github.com/libp2p/go-libp2p/p2p/transport/webrtc"
ws "github.com/libp2p/go-libp2p/p2p/transport/websocket"
"github.com/multiformats/go-multiaddr"
)
Expand Down Expand Up @@ -146,4 +147,14 @@ func TestDiscoverPeerID(t *testing.T) {
}
runTest(t, h)
})
t.Run("webrtc", func(t *testing.T) {
h, err := libp2p.New(
libp2p.Transport(libp2pwebrtc.New),
libp2p.ListenAddrStrings("/ip4/0.0.0.0/udp/0/webrtc-direct"),
)
if err != nil {
t.Fatal(err)
}
runTest(t, h)
})
}

0 comments on commit 20c87c3

Please sign in to comment.