@libp2p/interface-compliance-tests 1.1.17 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/src/index.d.ts +3 -0
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +30 -1
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/peer-discovery/index.d.ts.map +1 -1
  6. package/dist/src/peer-discovery/index.js +11 -10
  7. package/dist/src/peer-discovery/index.js.map +1 -1
  8. package/dist/src/pubsub/api.d.ts +2 -2
  9. package/dist/src/pubsub/api.d.ts.map +1 -1
  10. package/dist/src/pubsub/api.js.map +1 -1
  11. package/dist/src/pubsub/connection-handlers.d.ts +2 -2
  12. package/dist/src/pubsub/connection-handlers.d.ts.map +1 -1
  13. package/dist/src/pubsub/connection-handlers.js +8 -14
  14. package/dist/src/pubsub/connection-handlers.js.map +1 -1
  15. package/dist/src/pubsub/emit-self.d.ts +2 -2
  16. package/dist/src/pubsub/emit-self.d.ts.map +1 -1
  17. package/dist/src/pubsub/emit-self.js +5 -4
  18. package/dist/src/pubsub/emit-self.js.map +1 -1
  19. package/dist/src/pubsub/index.d.ts +2 -11
  20. package/dist/src/pubsub/index.d.ts.map +1 -1
  21. package/dist/src/pubsub/index.js.map +1 -1
  22. package/dist/src/pubsub/messages.d.ts +2 -2
  23. package/dist/src/pubsub/messages.d.ts.map +1 -1
  24. package/dist/src/pubsub/messages.js +3 -2
  25. package/dist/src/pubsub/messages.js.map +1 -1
  26. package/dist/src/pubsub/multiple-nodes.d.ts +2 -2
  27. package/dist/src/pubsub/multiple-nodes.d.ts.map +1 -1
  28. package/dist/src/pubsub/multiple-nodes.js +5 -4
  29. package/dist/src/pubsub/multiple-nodes.js.map +1 -1
  30. package/dist/src/pubsub/two-nodes.d.ts +2 -2
  31. package/dist/src/pubsub/two-nodes.d.ts.map +1 -1
  32. package/dist/src/pubsub/two-nodes.js +3 -4
  33. package/dist/src/pubsub/two-nodes.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/index.ts +49 -0
  36. package/src/peer-discovery/index.ts +14 -10
  37. package/src/pubsub/api.ts +3 -3
  38. package/src/pubsub/connection-handlers.ts +18 -24
  39. package/src/pubsub/emit-self.ts +8 -7
  40. package/src/pubsub/index.ts +2 -12
  41. package/src/pubsub/messages.ts +6 -5
  42. package/src/pubsub/multiple-nodes.ts +15 -22
  43. package/src/pubsub/two-nodes.ts +7 -8
@@ -11,11 +11,12 @@ import { CustomEvent } from '@libp2p/interfaces'
11
11
  import { waitForSubscriptionUpdate } from './utils.js'
12
12
  import type { TestSetup } from '../index.js'
13
13
  import type { Message } from '@libp2p/interfaces/pubsub'
14
- import type { EventMap, PubSubArgs } from './index.js'
14
+ import type { PubSubArgs } from './index.js'
15
15
  import type { PeerId } from '@libp2p/interfaces/peer-id'
16
16
  import type { Registrar } from '@libp2p/interfaces/registrar'
17
17
  import type { PubSubBaseProtocol } from '@libp2p/pubsub'
18
18
  import { Components } from '@libp2p/interfaces/components'
19
+ import { start, stop } from '../index.js'
19
20
 
20
21
  const topic = 'foo'
21
22
 
@@ -23,10 +24,10 @@ function shouldNotHappen () {
23
24
  expect.fail()
24
25
  }
25
26
 
26
- export default (common: TestSetup<PubSubBaseProtocol<EventMap>, PubSubArgs>) => {
27
+ export default (common: TestSetup<PubSubBaseProtocol, PubSubArgs>) => {
27
28
  describe('pubsub with two nodes', () => {
28
- let psA: PubSubBaseProtocol<EventMap>
29
- let psB: PubSubBaseProtocol<EventMap>
29
+ let psA: PubSubBaseProtocol
30
+ let psB: PubSubBaseProtocol
30
31
  let peerIdA: PeerId
31
32
  let peerIdB: PeerId
32
33
  let registrarA: Registrar
@@ -60,8 +61,7 @@ export default (common: TestSetup<PubSubBaseProtocol<EventMap>, PubSubArgs>) =>
60
61
  })
61
62
 
62
63
  // Start pubsub and connect nodes
63
- await psA.start()
64
- await psB.start()
64
+ await start(psA, psB)
65
65
 
66
66
  expect(psA.getPeers()).to.be.empty()
67
67
  expect(psB.getPeers()).to.be.empty()
@@ -81,8 +81,7 @@ export default (common: TestSetup<PubSubBaseProtocol<EventMap>, PubSubArgs>) =>
81
81
  afterEach(async () => {
82
82
  sinon.restore()
83
83
 
84
- await psA.stop()
85
- await psB.stop()
84
+ await stop(psA, psB)
86
85
 
87
86
  await common.teardown()
88
87
  })