Skip to content

Commit b8eeac6

Browse files
committed
chore: fix linting
1 parent 00fac66 commit b8eeac6

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

packages/client/test/index.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22

33
import { generateKeyPair } from '@libp2p/crypto/keys'
4-
import { start } from '@libp2p/interface'
4+
import { start, stop } from '@libp2p/interface'
55
import { peerIdFromPrivateKey, peerIdFromString } from '@libp2p/peer-id'
66
import { multiaddr } from '@multiformats/multiaddr'
77
import { expect } from 'aegir/chai'
@@ -20,14 +20,13 @@ const serverUrl = process.env.ECHO_SERVER
2020
describe('delegated-routing-v1-http-api-client', () => {
2121
let client: DelegatedRoutingV1HttpApiClient
2222

23-
beforeEach(() => {
23+
beforeEach(async () => {
2424
client = createDelegatedRoutingV1HttpApiClient(new URL(serverUrl), { cacheTTL: 0 })
25+
await start(client)
2526
})
2627

2728
afterEach(async () => {
28-
if (client != null) {
29-
client.stop()
30-
}
29+
await stop(client)
3130
})
3231

3332
it('should find providers', async () => {
@@ -396,6 +395,6 @@ describe('delegated-routing-v1-http-api-client', () => {
396395
callCount = parseInt(await (await fetch(`${process.env.ECHO_SERVER}/get-call-count`)).text(), 10)
397396
expect(callCount).to.equal(2) // Second server call after cache expired
398397

399-
clientWithShortTTL.stop()
398+
await stop(clientWithShortTTL)
400399
})
401400
})

packages/client/test/routings.spec.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-env mocha */
33

44
import { generateKeyPair } from '@libp2p/crypto/keys'
5-
import { contentRoutingSymbol, peerRoutingSymbol } from '@libp2p/interface'
5+
import { contentRoutingSymbol, peerRoutingSymbol, start, stop } from '@libp2p/interface'
66
import { peerIdFromPrivateKey } from '@libp2p/peer-id'
77
import { expect } from 'aegir/chai'
88
import { createIPNSRecord, marshalIPNSRecord, multihashToIPNSRoutingKey } from 'ipns'
@@ -22,14 +22,13 @@ if (serverUrl == null) {
2222
describe('libp2p content-routing', () => {
2323
let client: DelegatedRoutingV1HttpApiClient
2424

25-
beforeEach(() => {
25+
beforeEach(async () => {
2626
client = createDelegatedRoutingV1HttpApiClient(new URL(serverUrl), { cacheTTL: 0 })
27+
await start(client)
2728
})
2829

2930
afterEach(async () => {
30-
if (client != null) {
31-
client.stop()
32-
}
31+
await stop(client)
3332

3433
const res = await fetch(`${process.env.ECHO_SERVER}/reset-call-count`)
3534
await res.text()
@@ -192,14 +191,13 @@ describe('libp2p content-routing', () => {
192191
describe('libp2p peer-routing', () => {
193192
let client: DelegatedRoutingV1HttpApiClient
194193

195-
beforeEach(() => {
194+
beforeEach(async () => {
196195
client = createDelegatedRoutingV1HttpApiClient(new URL(serverUrl))
196+
await start(client)
197197
})
198198

199199
afterEach(async () => {
200-
if (client != null) {
201-
client.stop()
202-
}
200+
await stop(client)
203201
})
204202

205203
describe('peer routing', () => {

0 commit comments

Comments
 (0)