-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathlower_case.js
More file actions
27 lines (24 loc) · 788 Bytes
/
Copy pathlower_case.js
File metadata and controls
27 lines (24 loc) · 788 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
import v from '../voca';
describe('lowerCase', function() {
it('should return the lower case of a string', function() {
expect(v.lowerCase('Saturn')).toBe('saturn');
expect(v.lowerCase('EARTH')).toBe('earth');
expect(v.lowerCase('456')).toBe('456');
expect(v.lowerCase('')).toBe('');
});
it('should return the lower case of a string representation of an object', function() {
expect(v.lowerCase(['Venus'])).toBe('venus');
expect(
v.lowerCase({
toString: function() {
return 'Venus';
},
})
).toBe('venus');
});
it('should return empty string for null or undefined', function() {
expect(v.lowerCase()).toBe('');
expect(v.lowerCase(undefined)).toBe('');
expect(v.lowerCase(null)).toBe('');
});
});