Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

chore(lint): auto-fix prefer-const warnings in test files (#3533)

LearningCircuitee6f2f21a59e
diff --git a/tests/api_tests_with_login/test_helpers.js b/tests/api_tests_with_login/test_helpers.js
index e0aac5f44a..f090ec0f80 100644
--- a/tests/api_tests_with_login/test_helpers.js
+++ b/tests/api_tests_with_login/test_helpers.js
@@ -60,7 +60,7 @@ function executeCurl(command) {
// Parse HTTP response
const lines = output.split('\n');
let statusLine = '';
- let headers = {};
+ const headers = {};
let bodyStartIndex = 0;
// Find status line
diff --git a/tests/js/security/xss-protection.test.js b/tests/js/security/xss-protection.test.js
index 9e73e1a5c0..d15c5614ce 100644
--- a/tests/js/security/xss-protection.test.js
+++ b/tests/js/security/xss-protection.test.js
@@ -246,7 +246,6 @@ describe('escapeHtml fuzz / property tests', () => {
'<a href="javascript:alert(1)">x</a>',
];
for (const vector of vectors) {
- // eslint-disable-next-line no-unsanitized/property -- test code
div.innerHTML = escapeHtml(vector);
// No element children should have been created
expect(div.children.length).toBe(0);
diff --git a/tests/ui_tests/DEBUG_metrics_thread_fix.js b/tests/ui_tests/DEBUG_metrics_thread_fix.js
index 5aa959dc57..a1632c6eca 100644
--- a/tests/ui_tests/DEBUG_metrics_thread_fix.js
+++ b/tests/ui_tests/DEBUG_metrics_thread_fix.js
@@ -77,7 +77,7 @@ async function testMetricsThreadFix() {
// Check for any metrics data
const hasData = await page.evaluate(() => {
const tokenElements = document.querySelectorAll('.metric-value');
- for (let elem of tokenElements) {
+ for (const elem of tokenElements) {
if (elem.textContent && elem.textContent.trim() !== '0') {
return true;
}
diff --git a/tests/ui_tests/test_auth_flow.js b/tests/ui_tests/test_auth_flow.js
index 72792e5a78..9521a870b6 100644
--- a/tests/ui_tests/test_auth_flow.js
+++ b/tests/ui_tests/test_auth_flow.js
@@ -26,7 +26,7 @@ async function testAuthFlow() {
const browser = await puppeteer.launch(getPuppeteerLaunchOptions());
- let page = await browser.newPage();
+ const page = await browser.newPage();
const baseUrl = 'http://127.0.0.1:5000';
const authHelper = new AuthHelper(page, baseUrl);
diff --git a/tests/ui_tests/test_checkbox_settings.js b/tests/ui_tests/test_checkbox_settings.js
index 1f0c27d881..2db9c58ca7 100644
--- a/tests/ui_tests/test_checkbox_settings.js
+++ b/tests/ui_tests/test_checkbox_settings.js
@@ -531,7 +531,7 @@ const waitForAjaxResponse = async (responses, timeout = TEST_CONFIG.TIMEOUTS.AJA
// Test AJAX state persistence by checking DOM after successful save (no page reload)
console.log('\n🔄 Verifying AJAX State Persistence (no page reload)...');
let ajaxPersistenceTestsPassed = 0;
- let ajaxPersistenceTestsTotal = ajaxTestStates.length;
+ const ajaxPersistenceTestsTotal = ajaxTestStates.length;
for (const state of ajaxTestStates) {
try {
@@ -545,7 +545,7 @@ const waitForAjaxResponse = async (responses, timeout = TEST_CONFIG.TIMEOUTS.AJA
}
// Provide clear success/failure messaging
- let directionEmoji = state.direction === 'CHECKED_TO_UNCHECKED' ? '☑️→⬜' :
+ const directionEmoji = state.direction === 'CHECKED_TO_UNCHECKED' ? '☑️→⬜' :
state.direction === 'UNCHECKED_TO_CHECKED' ? '⬜→☑️' : '➡️';
console.log(`AJAX persistence test ${directionEmoji}:`);
diff --git a/tests/ui_tests/test_cost_analytics.js b/tests/ui_tests/test_cost_analytics.js
index 96f1a97649..dc482d7ddf 100644
--- a/tests/ui_tests/test_cost_analytics.js
+++ b/tests/ui_tests/test_cost_analytics.js
@@ -5,7 +5,7 @@ const { getPuppeteerLaunchOptions } = require('./puppeteer_config');
async function testCostAnalytics() {
let browser;
- let results = {
+ const results = {
success: false,
errors: [],
networkErrors: [],
diff --git a/tests/ui_tests/test_export_functionality.js b/tests/ui_tests/test_export_functionality.js
index 6abb9afd0f..bb04104a64 100644
--- a/tests/ui_tests/test_export_functionality.js
+++ b/tests/ui_tests/test_export_functionality.js
@@ -289,7 +289,7 @@ async function testExportFunctionality() {
log(`Current URL: ${currentUrl}`, 'info');
// If we're on the progress page and research is complete, results should be visible
- let hasResults = await page.$('.report-content, .markdown-content, .research-results');
+ const hasResults = await page.$('.report-content, .markdown-content, .research-results');
if (!hasResults) {
// For testing export functionality, we don't need to wait for results
diff --git a/tests/ui_tests/test_register_full_flow.js b/tests/ui_tests/test_register_full_flow.js
index f9c905b2f2..30ae3efa4c 100644
--- a/tests/ui_tests/test_register_full_flow.js
+++ b/tests/ui_tests/test_register_full_flow.js
@@ -128,8 +128,8 @@ async function testRegisterFullFlow() {
await page.type('input[name="password"]', 'abcdefg', { delay: 50 });
await new Promise(resolve => setTimeout(resolve, 200));
- let strengthBar = await page.$('#password-strength');
- let strengthVisible = await page.evaluate(el => el.style.display !== 'none', strengthBar);
+ const strengthBar = await page.$('#password-strength');
+ const strengthVisible = await page.evaluate(el => el.style.display !== 'none', strengthBar);
let strengthClasses = await page.evaluate(el => el.className, strengthBar);
console.log(` Weak password "abcdefg" - visible: ${strengthVisible}, classes: "${strengthClasses}"`);
diff --git a/tests/ui_tests/test_research_diagnosis.js b/tests/ui_tests/test_research_diagnosis.js
index f7616f6e9e..e2e6fb278e 100644
--- a/tests/ui_tests/test_research_diagnosis.js
+++ b/tests/ui_tests/test_research_diagnosis.js
@@ -169,7 +169,7 @@ async function testResearchDiagnosis() {
const form = document.getElementById('research-form');
if (form) {
const formData = new FormData(form);
- for (let [key, value] of formData.entries()) {
+ for (const [key, value] of formData.entries()) {
data[key] = value;
}
}
diff --git a/tests/ui_tests/test_research_searxng.js b/tests/ui_tests/test_research_searxng.js
index 5a88422490..a59607e6a7 100644
--- a/tests/ui_tests/test_research_searxng.js
+++ b/tests/ui_tests/test_research_searxng.js
@@ -62,7 +62,7 @@ async function testResearchWithSearxng() {
const select = document.querySelector('#search_engine');
if (select) {
// Try regular select
- for (let option of select.options) {
+ for (const option of select.options) {
if (option.value === 'searxng' || option.text.toLowerCase().includes('searxng')) {
select.value = option.value;
select.dispatchEvent(new Event('change'));
diff --git a/tests/ui_tests/test_toast_notifications.js b/tests/ui_tests/test_toast_notifications.js
index 2cfd56b5ee..469044939b 100644
--- a/tests/ui_tests/test_toast_notifications.js
+++ b/tests/ui_tests/test_toast_notifications.js
@@ -227,7 +227,7 @@ const TEST_CONFIG = {
};
}
- let toastInfo = [];
+ const toastInfo = [];
toasts.forEach((t, i) => {
const computed = window.getComputedStyle(t);
toastInfo.push({