Skip to content

Commit

Permalink
chore: add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <[email protected]>
  • Loading branch information
sfroment committed Jan 13, 2025
1 parent 872f53e commit fe46aa5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/is-pub-sub.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { stop, isPubSub } from '@libp2p/interface'
import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'
import { expect } from 'aegir/chai'
import { createComponents, type GossipSubAndComponents } from './utils/create-pubsub.js'

describe('is-pub-sub', () => {
let node: GossipSubAndComponents

before(async () => {
mockNetwork.reset()
node = await createComponents({})
})

after(async () => {
await stop(node.pubsub, ...Object.entries(node.components))
mockNetwork.reset()
})

it('should be a pub-sub node', () => {
expect(isPubSub(node.pubsub)).to.be.true()
})
})

0 comments on commit fe46aa5

Please sign in to comment.