-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
59 lines (59 loc) · 2.24 KB
/
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
var subject = require('./subject.js')
var mock = require('mock-fs');
subject.inc('',undefined);
subject.inc(-1,'');
subject.inc(-1,undefined);
subject.inc(-1,NaN);
subject.inc(0,NaN);
subject.inc(0,NaN);
subject.weird(8,'','','');
subject.weird('',-1,'','');
subject.weird('','',41,'');
subject.weird('','','',"strict");
subject.weird('','','','werw');
subject.weird('','','',"strict");
subject.weird('','','','notstrict');
subject.weird(8,-1,41,'notstrict');
subject.weird(7,-1,41,'notstrict');
subject.weird(7,0,41,'notstrict');
subject.weird(7,0,42,'notstrict');
subject.weird(7,0,42,NaN);
subject.weird(7,0,42,'werw');
subject.weird(7,0,42,"strict");
subject.weird(7,0,42,'notstrict');
subject.weird(7,0,42,'notstrict');
subject.fileTest('path/fileExists','');
subject.fileTest('','path/fileExists');
subject.fileTest('','pathContent/file1');
mock({"path/fileExists":{},"pathContent":{"file1":"text content"}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"path/fileExists":{"some-file.txt":"file content here"},"pathContent":{"file1":"text content"}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"path/fileExists":{}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"path/fileExists":{"some-file.txt":"file content here"}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"path/fileExists":{"some-file.txt":"file content here"},"pathContent":{"file1":""}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
subject.fileTest('path/fileExists','pathContent/file1');
subject.fileTest('path/fileExists','path/fileExists');
subject.fileTest('path/fileExists','pathContent/file1');
subject.fileTest('path/fileExists','pathContent/file1');
subject.normalize('892.116.4270');
subject.normalize('892.116.4270');
subject.format('170.341.0914','',{"normalize":true});
subject.format('170.341.0914','',{"normalize":true});
subject.blackListNumber('212123123');
subject.blackListNumber('213123123');
subject.blackListNumber('213123123');
subject.blackListNumber('212123123');
subject.blackListNumber('213123123');
subject.blackListNumber('213123123');