From cedafbde37abbe37b0f0da08bda0cbfb7dd2be26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 26 Aug 2023 22:36:32 +0200 Subject: [PATCH] test: improve deque coverage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/deque.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/deque.test.js b/tests/deque.test.js index 8521047d..386b8ae1 100644 --- a/tests/deque.test.js +++ b/tests/deque.test.js @@ -96,6 +96,22 @@ describe('Deque test suite', () => { expect(deque.tail).toBeUndefined() }) + it('Verify peekFirst() behavior', () => { + const deque = new Deque() + deque.push(1) + deque.push(2) + deque.push(3) + expect(deque.peekFirst()).toBe(1) + }) + + it('Verify peekLast() behavior', () => { + const deque = new Deque() + deque.push(1) + deque.push(2) + deque.push(3) + expect(deque.peekLast()).toBe(3) + }) + it('Verify clear() behavior', () => { const deque = new Deque() deque.push(1) -- 2.34.1