Skip to content

Added extra unit test to the "Linked List" exercise - #1448

Closed
JTMaher2 wants to merge 3 commits into
exercism:mainfrom
JTMaher2:main
Closed

JTMaher2 wants to merge 3 commits into
exercism:mainfrom
JTMaher2:main

Conversation

@JTMaher2

Copy link
Copy Markdown

I added an extra unit test that will fail if you have an "unshift()" function that does not handle the case where the list's tail is null.

@SleeplessByte

Copy link
Copy Markdown
Member

Is this not covered by:

xtest('unshift adds element at the start of the list', () => {
  const list = new LinkedList();
  list.unshift(23);
  list.unshift(5);
  expect(list.shift()).toBe(5);
  expect(list.shift()).toBe(23);
});

Do you have an example solution that passes without this test, but fails with the new test?

@junedev

junedev commented Oct 25, 2021

Copy link
Copy Markdown
Member

I am closing this for now as it seems abandoned. I am happy to re-open it once the requested example was provided.

@junedev junedev closed this Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

⌂ Proxy