mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-17 20:05:58 +00:00
Cleanup debug scripts
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
(async () => {
|
||||
console.log('--- DEBUG IMPORTS ---');
|
||||
|
||||
try {
|
||||
console.log('Importing check: lighthouse');
|
||||
const lighthouse = await import('lighthouse');
|
||||
console.log('Lighthouse keys:', Object.keys(lighthouse));
|
||||
console.log('Lighthouse Default type:', typeof lighthouse.default);
|
||||
|
||||
console.log('Importing check: chrome-launcher');
|
||||
const chromeLauncher = await import('chrome-launcher');
|
||||
console.log('ChromeLauncher keys:', Object.keys(chromeLauncher));
|
||||
console.log('ChromeLauncher Default type:', typeof chromeLauncher.default);
|
||||
console.log('ChromeLauncher Launch type:', typeof chromeLauncher.launch);
|
||||
|
||||
console.log('Importing check: uuid');
|
||||
const uuid = await import('uuid');
|
||||
console.log('UUID keys:', Object.keys(uuid));
|
||||
console.log('UUID v4 type:', typeof uuid.v4);
|
||||
console.log('UUID default type:', typeof uuid.default);
|
||||
|
||||
} catch (e) {
|
||||
console.error('CRITICAL IMPORT FAILURE:', e);
|
||||
}
|
||||
console.log('--- END DEBUG ---');
|
||||
})();
|
||||
@@ -1,26 +0,0 @@
|
||||
const chromeLauncher = require('chrome-launcher');
|
||||
|
||||
(async () => {
|
||||
console.log('Attempting to launch Chrome directly...');
|
||||
const chromePath = '/usr/bin/chromium';
|
||||
console.log(`Using path: ${chromePath}`);
|
||||
|
||||
try {
|
||||
const chrome = await chromeLauncher.launch({
|
||||
chromeFlags: ['--headless', '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
|
||||
chromePath: chromePath
|
||||
});
|
||||
console.log('SUCCESS: Chrome launched!');
|
||||
console.log('Port:', chrome.port);
|
||||
console.log('PID:', chrome.pid);
|
||||
|
||||
setTimeout(async () => {
|
||||
await chrome.kill();
|
||||
console.log('Chrome killed. Exiting.');
|
||||
}, 2000);
|
||||
} catch (e) {
|
||||
console.error('FAILURE: Chrome failed to launch.');
|
||||
console.error(e);
|
||||
console.error(JSON.stringify(e, null, 2));
|
||||
}
|
||||
})();
|
||||
@@ -1,25 +0,0 @@
|
||||
import * as chromeLauncher from 'chrome-launcher';
|
||||
|
||||
(async () => {
|
||||
console.log('Attempting to launch Chrome directly (ESM)...');
|
||||
const chromePath = '/usr/bin/chromium';
|
||||
console.log(`Using path: ${chromePath}`);
|
||||
|
||||
try {
|
||||
const chrome = await chromeLauncher.launch({
|
||||
chromeFlags: ['--headless', '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
|
||||
chromePath: chromePath
|
||||
});
|
||||
console.log('SUCCESS: Chrome launched!');
|
||||
console.log('Port:', chrome.port);
|
||||
console.log('PID:', chrome.pid);
|
||||
|
||||
setTimeout(async () => {
|
||||
await chrome.kill();
|
||||
console.log('Chrome killed. Exiting.');
|
||||
}, 2000);
|
||||
} catch (e) {
|
||||
console.error('FAILURE: Chrome failed to launch.');
|
||||
console.error(e);
|
||||
}
|
||||
})();
|
||||
@@ -1,17 +0,0 @@
|
||||
(async () => {
|
||||
console.log('Checking lighthouse exports...');
|
||||
try {
|
||||
const imported = await import('lighthouse');
|
||||
console.log('Import Keys:', Object.keys(imported));
|
||||
|
||||
if (imported.default) {
|
||||
console.log('Default export exists.');
|
||||
console.log('Verifying default is function:', typeof imported.default);
|
||||
} else {
|
||||
console.log('Default export is undefined.');
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Import failed:', e);
|
||||
}
|
||||
})();
|
||||
@@ -1,26 +0,0 @@
|
||||
(async () => {
|
||||
console.log('Checking chrome-launcher exports...');
|
||||
try {
|
||||
const imported = await import('chrome-launcher');
|
||||
console.log('Import Keys:', Object.keys(imported));
|
||||
|
||||
if (imported.default) {
|
||||
console.log('Default export exists.');
|
||||
console.log('Default keys:', Object.keys(imported.default));
|
||||
if (typeof imported.default.launch === 'function') {
|
||||
console.log('VERDICT: imported.default.launch is a function. (OK for Default Import)');
|
||||
} else {
|
||||
console.log('VERDICT: imported.default.launch is NOT a function.');
|
||||
}
|
||||
} else {
|
||||
console.log('Default export is undefined.');
|
||||
}
|
||||
|
||||
if (typeof imported.launch === 'function') {
|
||||
console.log('VERDICT: imported.launch is a function. (Use Named Import)');
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Import failed:', e);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user