-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy path.solcover.js
31 lines (28 loc) · 937 Bytes
/
.solcover.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
const fs = require('fs');
const path = require('path');
module.exports = {
coverageContractDepth: 10,
gasLimit: 10000000,
skipFiles: getSkipFiles(['deprecated', 'test', 'upgrades']),
};
function getSkipFiles(folders) {
const skipFiles = [];
const contractsPath = __dirname + '/contracts/';
folders.forEach(folderName => {
const testFolderPath = path.join(contractsPath, folderName);
function readFilesRecursively(folderPath) {
const files = fs.readdirSync(folderPath);
files.forEach(file => {
const filePath = path.join(folderPath, file);
const stats = fs.statSync(filePath);
if (stats.isDirectory()) {
readFilesRecursively(filePath);
} else if (stats.isFile() && path.extname(filePath) === '.sol') {
skipFiles.push(filePath.replace(contractsPath, ''));
}
});
}
readFilesRecursively(testFolderPath);
});
return skipFiles;
}