Skip to content

Commit 8e672b4

Browse files
committed
chore: disable upnp in ci
1 parent 56a3beb commit 8e672b4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

examples/js-libp2p-example-delegated-routing/test/index.spec.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
import { createDelegatedRoutingV1HttpApiServer } from '@helia/delegated-routing-v1-http-api-server'
33
import { peerIdFromString } from '@libp2p/peer-id'
4-
import { createHelia } from 'helia'
4+
import { createHelia, libp2pDefaults } from 'helia'
55
import { setup, expect } from 'test-ipfs-example/browser'
66

77
// Setup
@@ -18,6 +18,13 @@ let url
1818

1919
// start a libp2p node to delegate to
2020
async function spawnServer () {
21+
const libp2p = libp2pDefaults()
22+
23+
if (process.env.CI != null) {
24+
// do not use UPnP service in CI
25+
delete libp2p.services.upnp
26+
}
27+
2128
const helia = await createHelia({
2229
routers: [{
2330
// dummy router that always finds providers
@@ -34,7 +41,8 @@ async function spawnServer () {
3441
multiaddrs: []
3542
}
3643
}
37-
}]
44+
}],
45+
libp2p
3846
})
3947
const fastify = await createDelegatedRoutingV1HttpApiServer(helia, {
4048
listen: {

0 commit comments

Comments
 (0)