fix
This commit is contained in:
1 parent
08c620ee68
commit
dae82eeff2
5 files changed
+114
-11
No files matched your search
@@ -204,13 +204,16 @@ describe('CWMPTaskQueue — branch coverage', () => {
|
||||
const tq = new CWMPTaskQueue()
|
||||
const deviceId = new DeviceId('X', 'Y', 'Z', 'S')
|
||||
|
||||
tq.addCWMPTask(deviceId, 'get_parameter_values', ['a']) // PENDING
|
||||
const pendingTask = tq.addCWMPTask(deviceId, 'get_parameter_values', ['a']) // PENDING
|
||||
const { taskId: sentId } = tq.addTask(deviceId, 'set_parameter_values', {}, async () => '') // SENT
|
||||
|
||||
tq.clearPendingTasksForDevice(deviceId)
|
||||
|
||||
// clearPendingTasksForDevice clears ALL tasks (PENDING and SENT) to avoid
|
||||
// ghost entries bleeding into the next session
|
||||
const tasks = (tq as any).tasks as Map<string, any>
|
||||
expect(tasks.has(sentId)).toBe(true)
|
||||
expect(tasks.has(pendingTask.id)).toBe(false)
|
||||
expect(tasks.has(sentId)).toBe(false)
|
||||
})
|
||||
|
||||
it('registerCallback adds callback for existing task', () => {
|
||||
|
||||
Reference in new issue
Block a user