39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
// Test the core audit logging functionality
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Test that the audit logging structure is correct
|
|
console.log('Testing audit logging system...');
|
|
|
|
// Check that the main.js file has the required functions
|
|
const mainJsContent = fs.readFileSync('./main.js', 'utf8');
|
|
|
|
// Verify writeAuditLog function exists
|
|
if (mainJsContent.includes('function writeAuditLog')) {
|
|
console.log('✅ writeAuditLog function found');
|
|
} else {
|
|
console.log('❌ writeAuditLog function NOT found');
|
|
}
|
|
|
|
// Verify log-audit-event handler exists
|
|
if (mainJsContent.includes('ipcMain.handle(\'log-audit-event\'')) {
|
|
console.log('✅ log-audit-event handler found');
|
|
} else {
|
|
console.log('❌ log-audit-event handler NOT found');
|
|
}
|
|
|
|
// Verify command line argument parsing
|
|
if (mainJsContent.includes('commandLineDirectory = process.argv.find')) {
|
|
console.log('✅ Command line argument parsing found');
|
|
} else {
|
|
console.log('❌ Command line argument parsing NOT found');
|
|
}
|
|
|
|
// Verify audit file creation logic
|
|
if (mainJsContent.includes('const auditFileName = \'.audit\'')) {
|
|
console.log('✅ Audit file naming logic found');
|
|
} else {
|
|
console.log('❌ Audit file naming logic NOT found');
|
|
}
|
|
|
|
console.log('Audit system test completed.'); |