main funcions fixes
This commit is contained in:
78
desktop-operator/test.js
Normal file
78
desktop-operator/test.js
Normal file
@@ -0,0 +1,78 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
console.log('🧪 Тестирование GodEye Operator...\n');
|
||||
|
||||
// Проверяем синтаксис файлов
|
||||
const filesToCheck = [
|
||||
'src/main.js',
|
||||
'src/config.js',
|
||||
'src/renderer/app.js'
|
||||
];
|
||||
|
||||
console.log('1️⃣ Проверка синтаксиса файлов:');
|
||||
filesToCheck.forEach(file => {
|
||||
try {
|
||||
const content = fs.readFileSync(file, 'utf8');
|
||||
// Простая проверка на парность скобок
|
||||
const braces = (content.match(/\{/g) || []).length - (content.match(/\}/g) || []).length;
|
||||
const parens = (content.match(/\(/g) || []).length - (content.match(/\)/g) || []).length;
|
||||
const brackets = (content.match(/\[/g) || []).length - (content.match(/\]/g) || []).length;
|
||||
|
||||
if (braces === 0 && parens === 0 && brackets === 0) {
|
||||
console.log(` ✅ ${file} - OK`);
|
||||
} else {
|
||||
console.log(` ❌ ${file} - Неправильная структура скобок`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(` ❌ ${file} - Ошибка чтения: ${error.message}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Проверяем HTML элементы
|
||||
console.log('\n2️⃣ Проверка HTML элементов:');
|
||||
try {
|
||||
const html = fs.readFileSync('src/renderer/index.html', 'utf8');
|
||||
|
||||
const requiredElements = [
|
||||
'auto-connect',
|
||||
'connection-status-text',
|
||||
'ping-indicator',
|
||||
'screenshot-btn',
|
||||
'fullscreen-btn',
|
||||
'zoom-btn',
|
||||
'pip-btn'
|
||||
];
|
||||
|
||||
let missing = [];
|
||||
requiredElements.forEach(id => {
|
||||
if (html.includes(`id="${id}"`)) {
|
||||
console.log(` ✅ ${id} найден`);
|
||||
} else {
|
||||
console.log(` ❌ ${id} отсутствует`);
|
||||
missing.push(id);
|
||||
}
|
||||
});
|
||||
|
||||
if (missing.length === 0) {
|
||||
console.log(' 🎉 Все новые UI элементы найдены!');
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(` ❌ Ошибка чтения HTML: ${error.message}`);
|
||||
}
|
||||
|
||||
// Проверяем package.json
|
||||
console.log('\n3️⃣ Проверка package.json:');
|
||||
try {
|
||||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
console.log(` ✅ Electron версия: ${pkg.devDependencies.electron}`);
|
||||
console.log(` ✅ Socket.IO версия: ${pkg.dependencies['socket.io-client']}`);
|
||||
console.log(` ✅ UUID версия: ${pkg.dependencies.uuid}`);
|
||||
|
||||
const scripts = Object.keys(pkg.scripts);
|
||||
console.log(` ✅ Доступные скрипты: ${scripts.join(', ')}`);
|
||||
} catch (error) {
|
||||
console.log(` ❌ Ошибка чтения package.json: ${error.message}`);
|
||||
}
|
||||
|
||||
console.log('\n✨ Тестирование завершено!');
|
||||
Reference in New Issue
Block a user