Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:only": "mate-scripts test",
"update": "mate-scripts update",
"postinstall": "npm run update",
"test": "npm run lint && npm run test:only"
"test": "jest"
},
"author": "Mate academy",
"license": "GPL-3.0",
Expand Down
30 changes: 30 additions & 0 deletions src/isIsogram.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,34 @@ describe('isIsogram', () => {
it(`should be declared`, () => {
expect(isIsogram).toBeInstanceOf(Function);
});

it(`should return true if string empty`, () => {
const result = isIsogram('');

expect(result).toBeTruthy();
});

it(`should return true if word has no repeating letters `, () => {
const result = isIsogram('playgrounds');

expect(result).toBeTruthy();
});

it(`should return false if word has repeating letters`, () => {
const result = isIsogram('look');

expect(result).toBeFalsy();
});

it(`returns false for non-adjacent duplicates ignoring case`, () => {
const result = isIsogram('Adam');

expect(result).toBeFalsy();
});

it(`returns false for adjacent duplicates ignoring case`, () => {
const result = isIsogram('Oops');

expect(result).toBeFalsy();
});
});
Loading