-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathCheckFlatCase.test.js
More file actions
22 lines (18 loc) · 757 Bytes
/
CheckFlatCase.test.js
File metadata and controls
22 lines (18 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { checkFlatCase } from '../CheckFlatCase'
describe('checkFlatCase function', () => {
it('should return false when the input string is not in flatcase', () => {
const actual = checkFlatCase('this is not in flatcase')
expect(actual).toBe(false)
})
it('should return true when the input string is a single letter character', () => {
const actual = checkFlatCase('a')
expect(actual).toBe(true)
})
it('should return true when the input string is a string of lowercase letter characters with no spaces', () => {
const actual = checkFlatCase('abcdefghijklmnopqrstuvwxyz')
expect(actual).toBe(true)
})
it('should throw when input is not a string', () => {
expect(() => checkFlatCase(100)).toThrowError()
})
})