Skip to content
Open
Changes from all 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
32 changes: 32 additions & 0 deletions src/isIsogram.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,36 @@ describe('isIsogram', () => {
it(`should be declared`, () => {
expect(isIsogram).toBeInstanceOf(Function);
});

it('returns true for an empty string', () => {
expect(isIsogram('')).toBe(true);
});

it('returns true for a word with all unique letters', () => {
expect(isIsogram('playgrounds')).toBe(true);
});

it('returns false for a word with repeating consecutive letters', () => {
expect(isIsogram('look')).toBe(false);
});

it('returns false for a word with repeating non-consecutive letters', () => {
expect(isIsogram('banana')).toBe(false);
});

it('treats uppercase and lowercase letters as the same', () => {
expect(isIsogram('Adam')).toBe(false);
});

it('returns false for a word with mixed-case duplicates', () => {
expect(isIsogram('Oops')).toBe(false);
});

it('returns true for a single-letter string', () => {
expect(isIsogram('A')).toBe(true);
});

it('returns true for a long known isogram', () => {
expect(isIsogram('subdermatoglyphic')).toBe(true);
});
});