forked from vineetakhurana/TestGeneration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
38 lines (38 loc) · 1.4 KB
/
test.js
File metadata and controls
38 lines (38 loc) · 1.4 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
34
35
36
37
38
var subject = require('./subject.js')
var mock = require('mock-fs');
var faker = require('faker');
subject.inc('',undefined);
subject.inc('',"defined");
subject.inc(0- 1,"defined");
subject.inc(0- 1,"defined");
subject.fileTest('path/fileExists','');
subject.fileTest('path/fileExists','path/fileExists');
subject.fileTest('path/fileExists','pathContent/file1');
mock({"path/fileExists":{},"pathContent":{"file1":"text content"}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"pathContent":{"file1":""}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"path/fileExists":{},"pathContent":{"file1":""}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"pathContent":{"file1":"text content"}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
mock({"path/fileExists":{}});
subject.fileTest('path/fileExists','pathContent/file1');
mock.restore();
for(i = 0; i < 6000; i++){
subject.normalize(faker.phone.phoneNumber());
}
subject.normalize(faker.phone.phoneNumber());
for(i = 0; i < 6000; i++){
subject.format(faker.phone.phoneNumber(),'','');
}
subject.format(faker.phone.phoneNumber(),'',{normalize: true });
subject.format(faker.phone.phoneNumber(),'',{normalize: true });
for(i = 0; i < 6000; i++){
subject.blackListNumber(faker.phone.phoneNumber());
}
subject.blackListNumber(faker.phone.phoneNumber());