forked from angus-c/just
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (29 loc) · 1.16 KB
/
Copy pathindex.js
File metadata and controls
33 lines (29 loc) · 1.16 KB
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
var test = require('../util/test')(__filename);
var kebabCase = require('../../packages/string-kebab-case');
test('string with spaces', function(t) {
t.plan(2);
t.equal(kebabCase('the quick brown fox'), 'the-quick-brown-fox');
t.equal(kebabCase('the quick brownfox'), 'the-quick-brownfox');
t.end();
});
test('string with punctuation', function(t) {
t.plan(4);
t.equal(kebabCase('the_quick_brown_fox'), 'the-quick-brown-fox');
t.equal(kebabCase('the_quick_brown_fox'), 'the-quick-brown-fox');
t.equal(kebabCase('the*quick-brown_fox'), 'the-quick-brown-fox');
t.equal(kebabCase('the****quick-_-brown_:fox'), 'the-quick-brown-fox');
t.end();
});
test('string with mixed spaces and punctuation', function(t) {
t.plan(2);
t.equal(kebabCase('the_quick_brown_ fox'), 'the-quick-brown-fox');
t.equal(kebabCase('the** **quick-_-brown_:fox'), 'the-quick-brown-fox');
t.end();
});
test('string with capitalization', function(t) {
t.plan(3);
t.equal(kebabCase('theQuickBrownFox'), 'the-quick-brown-fox');
t.equal(kebabCase('the QuickBrown Fox'), 'the-quick-brown-fox');
t.equal(kebabCase('The quick brown FOX'), 'the-quick-brown-f-o-x');
t.end();
});