-
Notifications
You must be signed in to change notification settings - Fork 778
/
files.spec.js
84 lines (67 loc) · 2.15 KB
/
files.spec.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
76
77
78
79
80
81
82
83
84
var assert = require('assert');
var fs = require('fs');
describe('sendgrid-nodejs repo', function() {
/*
it('should have ./Docker or docker/Docker file', function() {
assert(fileExists('Docker') || fileExists('docker/Docker'));
});
it('should have ./docker-compose.yml or ./docker/docker-compose.yml file', function() {
assert(fileExists('docker-compose.yml') || fileExists('docker/docker-compose.yml'));
});
*/
it('should have ./.env_sample file', function() {
assert(fileExists('.env_sample'));
});
it('should have ./.gitignore file', function() {
assert(fileExists('.gitignore'));
});
it('should have ./.github/workflows/test-and-deploy file', function() {
assert(fileExists('.github/workflows/test-and-deploy.yml'));
});
it('should have ./.codeclimate.yml file', function() {
assert(fileExists('.codeclimate.yml'));
});
it('should have ./CHANGELOG.md file', function() {
assert(fileExists('CHANGELOG.md'));
});
it('should have ./CODE_OF_CONDUCT.md file', function() {
assert(fileExists('CODE_OF_CONDUCT.md'));
});
it('should have ./CONTRIBUTING.md file', function() {
assert(fileExists('CONTRIBUTING.md'));
});
it('should have ./ISSUE_TEMPLATE.md file', function() {
assert(fileExists('ISSUE_TEMPLATE.md'));
});
it('should have ./LICENSE file', function() {
assert(fileExists('LICENSE'));
});
it('should have ./PULL_REQUEST_TEMPLATE.md file', function() {
assert(fileExists('PULL_REQUEST_TEMPLATE.md'));
});
it('should have ./README.md file', function() {
assert(fileExists('README.md'));
});
it('should have ./TROUBLESHOOTING.md file', function() {
assert(fileExists('TROUBLESHOOTING.md'));
});
it('should have ./USAGE.md file', function() {
assert(fileExists('USAGE.md'));
});
/*
it('should have ./USE_CASES.md file', function() {
assert(fileExists('USE_CASES.md'));
});
*/
function fileExists(filepath) {
try {
return fs.statSync(filepath).isFile();
} catch(e) {
if (e.code === 'ENOENT') {
console.log('' + filepath + ' doesn\'t exist.');
return false;
}
throw e;
}
}
});