51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
describe('Simple', function() {
|
|
this.timeout(120000);
|
|
|
|
it('should execute test successfully', async function() {
|
|
const { expect } = require('chai');
|
|
console.log('Starting simple test...');
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function findSatLocFiles(dir, fileList = []) {
|
|
console.log('Searching directory:', dir);
|
|
|
|
if (!fs.existsSync(dir)) {
|
|
console.log('Directory does not exist:', dir);
|
|
return fileList;
|
|
}
|
|
|
|
const items = fs.readdirSync(dir);
|
|
console.log('Found items:', items.length);
|
|
|
|
for (const item of items) {
|
|
const fullPath = path.join(dir, item);
|
|
const stat = fs.statSync(fullPath);
|
|
|
|
if (stat.isDirectory()) {
|
|
console.log('Found subdirectory:', item);
|
|
// Recursively search subdirectories
|
|
findSatLocFiles(fullPath, fileList);
|
|
} else if (stat.isFile()) {
|
|
// Check if it's a potential SatLoc file
|
|
const fileName = item.toLowerCase();
|
|
if (fileName.endsWith('.log') ||
|
|
fileName.endsWith('.txt') ||
|
|
(fileName.includes('satloc') && !fileName.endsWith('.csv'))) {
|
|
console.log('Found SatLoc file:', item);
|
|
fileList.push(fullPath);
|
|
}
|
|
}
|
|
}
|
|
|
|
return fileList;
|
|
}
|
|
|
|
console.log('Testing file search...');
|
|
const files = findSatLocFiles('./test-logs');
|
|
console.log('Total files found:', files.length);
|
|
files.forEach(f => console.log(' -', f));
|
|
console.log('Test complete.');
|
|
});
|
|
}); |