Skip to content

Commit fe46aa5

Browse files
committed
chore: add unit test
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
1 parent 872f53e commit fe46aa5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/is-pub-sub.spec.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { stop, isPubSub } from '@libp2p/interface'
2+
import { mockNetwork } from '@libp2p/interface-compliance-tests/mocks'
3+
import { expect } from 'aegir/chai'
4+
import { createComponents, type GossipSubAndComponents } from './utils/create-pubsub.js'
5+
6+
describe('is-pub-sub', () => {
7+
let node: GossipSubAndComponents
8+
9+
before(async () => {
10+
mockNetwork.reset()
11+
node = await createComponents({})
12+
})
13+
14+
after(async () => {
15+
await stop(node.pubsub, ...Object.entries(node.components))
16+
mockNetwork.reset()
17+
})
18+
19+
it('should be a pub-sub node', () => {
20+
expect(isPubSub(node.pubsub)).to.be.true()
21+
})
22+
})

0 commit comments

Comments
 (0)