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

const isIsogramMap = {
playgrounds: true,
look: false,
Adam: false,
'': true,
Oops: false,
};

for (const key in isIsogramMap) {
it(`should ${isIsogramMap[key]} if ${key} passed`, () => {

Choose a reason for hiding this comment

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

The generated test descriptions are not very clear, especially for the empty string, which results in should true if passed. According to the requirements, each test case should have a clear and unique description. Consider rewording this to be more explicit, for example: it(should return ${isIsogramMap[key]} for the word "${key}", ...).

expect(isIsogram(key)).toBe(isIsogramMap[key]);
});
}
});