-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathfilename.spec.ts
48 lines (44 loc) · 1 KB
/
filename.spec.ts
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
import natsort from '../../src'
describe('filename: ', () => {
it('simple image filename', () => {
expect([
'img1.png',
'img12.png',
'img10.png',
'img2.png',
'img1.png',
].sort(natsort())).toEqual([
'img1.png',
'img1.png',
'img2.png',
'img10.png',
'img12.png',
])
})
it('complex filename', () => {
expect([
'car.mov',
'01alpha.sgi',
'001alpha.sgi',
'my.string_41299.tif',
'organic2.0001.sgi',
].sort(natsort())).toEqual([
'001alpha.sgi',
'01alpha.sgi',
'car.mov',
'my.string_41299.tif',
'organic2.0001.sgi',
])
})
it('unix filename', () => {
expect([
'./system/kernel/js/01_ui.core.js',
'./system/kernel/js/00_jquery-1.3.2.js',
'./system/kernel/js/02_my.desktop.js',
].sort(natsort())).toEqual([
'./system/kernel/js/00_jquery-1.3.2.js',
'./system/kernel/js/01_ui.core.js',
'./system/kernel/js/02_my.desktop.js',
])
})
})