Skip to content

Commit

Permalink
chore: fix dcutr test
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Nov 1, 2023
1 parent 29eb610 commit 8297aa8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/libp2p/test/dcutr/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { multiaddr } from '@multiformats/multiaddr'
import { expect } from 'aegir/chai'
import Sinon from 'sinon'
import { stubInterface } from 'sinon-ts'
import { isPublicAndDialable } from '../../src/dcutr/utils.js'
import type { Transport } from '@libp2p/interface/transport'
Expand All @@ -23,7 +24,7 @@ describe('dcutr utils', () => {
for (const [key, value] of Object.entries(testCases)) {
it(`should ${value ? '' : 'not '}allow ${key}`, () => {
const transportManager = stubInterface<TransportManager>({
transportForMultiaddr: stubInterface<Transport>()
transportForMultiaddr: Sinon.stub().returns(stubInterface<Transport>())
})

expect(isPublicAndDialable(multiaddr(key), transportManager)).to.equal(value)
Expand Down

0 comments on commit 8297aa8

Please sign in to comment.