From fe46aa50e35764cca97c7852fe7142f0e3dc1283 Mon Sep 17 00:00:00 2001 From: Sacha Froment Date: Mon, 13 Jan 2025 15:32:37 +0100 Subject: [PATCH] chore: add unit test Signed-off-by: Sacha Froment --- test/is-pub-sub.spec.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/is-pub-sub.spec.ts diff --git a/test/is-pub-sub.spec.ts b/test/is-pub-sub.spec.ts new file mode 100644 index 00000000..3a77174b --- /dev/null +++ b/test/is-pub-sub.spec.ts @@ -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() + }) +})