Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/isIsogram.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,24 @@ describe('isIsogram', () => {
it(`should be declared`, () => {
expect(isIsogram).toBeInstanceOf(Function);
});

it(`should return true for empty string`, () => {
expect(isIsogram('')).toBe(true);
});

it(`should return true
if all the letters in the string are different`, () => {
expect(isIsogram('playground')).toBe(true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is functionally correct, but the requirements specify testing with 'playgrounds'. While 'playground' is also an isogram, it's best practice to use the exact examples provided in the task description.

});

it(`should return false
if any of the letters in the string repeat`, () => {
expect(isIsogram('whoops')).toBe(false);
});

it(`should return false
if any of the letters in the string repeat
while ignoring the letter case`, () => {
expect(isIsogram('Analogy')).toBe(false);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing tests are good, but the test suite is incomplete. According to the requirements, you also need to add tests for the following inputs: 'look', 'Adam', and 'Oops'.

});