-
Notifications
You must be signed in to change notification settings - Fork 556
Expand file tree
/
Copy pathisIsogram.test.js
More file actions
47 lines (35 loc) · 943 Bytes
/
isIsogram.test.js
File metadata and controls
47 lines (35 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
describe('isIsogram', () => {
const { isIsogram } = require('./isIsogram');
it(`should be declared`, () => {
expect(isIsogram).toBeInstanceOf(Function);
});
it(`should return true for an empty line`, () => {
expect(isIsogram(''))
.toBe(true);
});
it(`should return false for words with repeating letters`, () => {
expect(isIsogram('look'))
.toBe(false);
expect(isIsogram('oops'))
.toBe(false);
expect(isIsogram('adam'))
.toBe(false);
});
it(`should be case insensitive`, () => {
expect(isIsogram('Adam'))
.toBe(false);
expect(isIsogram('oOps'))
.toBe(false);
expect(isIsogram('bOo'))
.toBe(false);
});
it(`should return true for a valid isogram`, () => {
expect(isIsogram('playgrounds'))
.toBe(true);
expect(isIsogram('isogram'))
.toBe(true);
expect(isIsogram('false'))
.toBe(true);
});
});