-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathensure-case.test.js
75 lines (59 loc) · 1.74 KB
/
ensure-case.test.js
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import test from 'ava';
import ensure from './ensure-case';
test('true for no params', t => {
const actual = ensure();
t.is(actual, true);
});
test('true for empty', t => {
const actual = ensure('');
t.is(actual, true);
});
test('true for lowercase', t => {
const actual = ensure('a');
t.is(actual, true);
});
test('false for uppercase', t => {
const actual = ensure('A');
t.is(actual, false);
});
test('true for lowercase on lowercase', t => {
const actual = ensure('a', 'lowercase');
t.is(actual, true);
});
test('false for uppercase on lowercase', t => {
const actual = ensure('A', 'lowercase');
t.is(actual, false);
});
test('true for uppercase on uppercase', t => {
const actual = ensure('A', 'uppercase');
t.is(actual, true);
});
test('false for lowercase on lowercase', t => {
const actual = ensure('a', 'uppercase');
t.is(actual, false);
});
test('true for sentencecase on sentencecase', t => {
const actual = ensure('Sentence case', 'sentence-case');
t.is(actual, true);
});
test('false for lowsercase on sentencecase', t => {
t.is(ensure('sentence case', 'sentence-case'), false);
});
test('false for UPPERCASE on sentencecase', t => {
t.is(ensure('UPPERCASE', 'sentence-case'), false);
});
test('false for Start Case on sentencecase', t => {
t.is(ensure('Start Case', 'sentence-case'), false);
});
test('false for PascalCase on sentencecase', t => {
t.is(ensure('PascalCase', 'sentence-case'), false);
});
test('false for kebab-case on sentencecase', t => {
t.is(ensure('kebab-case', 'sentence-case'), false);
});
test('false for snake_case on sentencecase', t => {
t.is(ensure('snake_case', 'sentence-case'), false);
});
test('false for camelCase on sentencecase', t => {
t.is(ensure('camelCase', 'sentence-case'), false);
});