test: improve queue test
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Jun 2023 09:44:01 +0000 (11:44 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Jun 2023 09:44:01 +0000 (11:44 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/queue.test.js

index 6451b732e2c71d9753e1344f5b3683ed70f2f205..3a61f43df48b5f8c34a0047389de2c0889fe3973 100644 (file)
@@ -37,18 +37,21 @@ describe('Queue test suite', () => {
     expect(rtItem).toBe(1)
     expect(queue.head).toBe(1)
     expect(queue.tail).toBe(3)
+    expect(queue.max).toBe(3)
     expect(queue.items).toStrictEqual({ 1: 2, 2: 3 })
     rtItem = queue.dequeue()
     expect(queue.size).toBe(1)
     expect(rtItem).toBe(2)
     expect(queue.head).toBe(2)
     expect(queue.tail).toBe(3)
+    expect(queue.max).toBe(3)
     expect(queue.items).toStrictEqual({ 2: 3 })
     rtItem = queue.dequeue()
     expect(queue.size).toBe(0)
     expect(rtItem).toBe(3)
     expect(queue.head).toBe(0)
     expect(queue.tail).toBe(0)
+    expect(queue.max).toBe(3)
     expect(queue.items).toStrictEqual({})
   })
 })