describe('getSocketInfo', () => {
it('returns an array of objects reporting number of data channels per socket', () => {
m = new WS2Manager()
m._sockets.push({
pendingSubscriptions: [[], [], []],
pendingUnsubscriptions: [[]],
ws: { getDataChannelCount: () => 2 }
})
m._sockets.push({
pendingSubscriptions: [[], [], []],
pendingUnsubscriptions: [[]],
ws: { getDataChannelCount: () => 3 }
})
const info = m.getSocketInfo()
assert.ok(_isArray(info), 'did not return array')
info.forEach(i => assert.ok(_isObject(i), 'socket info not an object'))
assert.strictEqual(info[0].nChannels, 4, 'socket info does not report correct number of channels')
assert.strictEqual(info[1].nChannels, 5, 'socket info does not report correct number of channels')
})
})