comq 0.17.1 → 0.19.0

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.
@@ -93,7 +93,7 @@ describe('bound', () => {
93
93
 
94
94
  const { queue: asserted } = await chan.assertQueue.mock.results[0].value
95
95
 
96
- expect(chan.bindQueue).toHaveBeenCalledTimes(1)
96
+ expect(bindings()).toHaveLength(1)
97
97
  expect(chan.bindQueue).toHaveBeenCalledWith(asserted, exchange, key)
98
98
  })
99
99
 
@@ -107,13 +107,17 @@ describe('bound', () => {
107
107
  await channel.bound(exchange, queue, key, consumer)
108
108
  await channel.bound(exchange, queue, key, consumer)
109
109
 
110
- expect(chan.bindQueue).toHaveBeenCalledTimes(1)
110
+ expect(bindings()).toHaveLength(1)
111
111
  })
112
112
 
113
113
  it('should bind again for another key', async () => {
114
114
  await channel.bound(exchange, queue, key, consumer)
115
115
  await channel.bound(exchange, generate(), generate(), consumer)
116
116
 
117
- expect(chan.bindQueue).toHaveBeenCalledTimes(2)
117
+ expect(bindings()).toHaveLength(2)
118
118
  })
119
+
120
+ /** The bindings of the caller, less the one comq makes for its own retry queue. */
121
+ const bindings = () =>
122
+ chan.bindQueue.mock.calls.filter(([, exchange]) => !exchange.startsWith('comq.'))
119
123
  })