Skip to content

Commit 105be67

Browse files
committed
refactor(tests): remove unused variables in test files
Address Copilot review feedback: - Remove unused 'name' in CLI_TOOLS iteration - Use more descriptive variable names in cache refresh test - Remove unused multiPassFindings and mediumFindings variables
1 parent b70f4d6 commit 105be67

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

__tests__/cli-enhancers.test.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('cli-enhancers', () => {
7676
});
7777

7878
it('each tool should have required fields', () => {
79-
for (const [name, tool] of Object.entries(CLI_TOOLS)) {
79+
for (const tool of Object.values(CLI_TOOLS)) {
8080
expect(tool.name).toBeDefined();
8181
expect(tool.description).toBeDefined();
8282
expect(tool.checkCommand).toBeDefined();
@@ -309,14 +309,15 @@ describe('cli-enhancers', () => {
309309

310310
it('should refresh cache when forceRefresh is true', () => {
311311
fs.writeFileSync(path.join(tempDir, 'package.json'), '{}');
312-
const result1 = getToolAvailabilityForRepo(tempDir);
312+
getToolAvailabilityForRepo(tempDir); // Initial cache
313313
// Add Python
314314
fs.writeFileSync(path.join(tempDir, 'requirements.txt'), 'flask\n');
315-
// Without force refresh, should still show only JS
316-
const result2 = getToolAvailabilityForRepo(tempDir);
315+
// Without force refresh, should still show only JS (cached)
316+
const cachedResult = getToolAvailabilityForRepo(tempDir);
317+
expect(cachedResult.languages).not.toContain('python');
317318
// With force refresh, should detect Python too
318-
const result3 = getToolAvailabilityForRepo(tempDir, { forceRefresh: true });
319-
expect(result3.languages).toContain('python');
319+
const refreshedResult = getToolAvailabilityForRepo(tempDir, { forceRefresh: true });
320+
expect(refreshedResult.languages).toContain('python');
320321
});
321322
});
322323

__tests__/pipeline.test.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,9 @@ function foo() {
446446
targetFiles: ['test.js']
447447
});
448448

449-
// Normal mode includes multi-pass analyzers
450-
const multiPassFindings = result.findings.filter(f => f.certainty === CERTAINTY.MEDIUM);
451-
// May or may not have findings depending on thresholds
449+
// Normal mode includes multi-pass analyzers (may or may not have findings depending on thresholds)
452450
expect(result.findings).toBeDefined();
451+
expect(result.metadata.thoroughness).toBe('normal');
453452
});
454453

455454
it('should track missing tools in deep mode', () => {
@@ -609,10 +608,10 @@ function foo() {
609608
targetFiles: ['test.js']
610609
});
611610

612-
// Should have MEDIUM certainty findings from multi-pass
613-
const mediumFindings = result.findings.filter(f => f.certainty === CERTAINTY.MEDIUM);
614-
// The doc_code_ratio should detect the excessive JSDoc
615-
expect(result.findings.length).toBeGreaterThanOrEqual(0);
611+
// Should run multi-pass analyzers which may produce MEDIUM certainty findings
612+
// The doc_code_ratio analyzer may detect the excessive JSDoc if it meets thresholds
613+
expect(result.findings).toBeDefined();
614+
expect(result.metadata.thoroughness).toBe('normal');
616615
});
617616

618617
it('deep mode should track missing CLI tools', () => {

0 commit comments

Comments
 (0)