Skip to content

Commit fe59736

Browse files
superlowburnclaude
andcommitted
fix: import isTestFile from production instead of reimplementing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ae8403d commit fe59736

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

convex/llmEval.test.ts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
import { describe, expect, it } from 'vitest'
2-
3-
/**
4-
* Helper to test the isTestFile function (not exported, so we recreate it for testing)
5-
*/
6-
function isTestFile(path: string): boolean {
7-
const lower = path.toLowerCase()
8-
9-
// Common test file patterns
10-
if (lower.endsWith('.test.ts')) return true
11-
if (lower.endsWith('.test.js')) return true
12-
if (lower.endsWith('.test.tsx')) return true
13-
if (lower.endsWith('.test.jsx')) return true
14-
if (lower.endsWith('.spec.ts')) return true
15-
if (lower.endsWith('.spec.js')) return true
16-
if (lower.endsWith('.spec.tsx')) return true
17-
if (lower.endsWith('.spec.jsx')) return true
18-
19-
// Common test directories
20-
const parts = path.split('/')
21-
for (const part of parts) {
22-
const lowerPart = part.toLowerCase()
23-
if (lowerPart === '__tests__') return true
24-
if (lowerPart === 'tests') return true
25-
if (lowerPart === 'test') return true
26-
if (lowerPart === '__mocks__') return true
27-
if (lowerPart === 'mocks') return true
28-
}
29-
30-
return false
31-
}
2+
import { isTestFile } from './llmEval'
323

334
describe('llmEval test file filtering', () => {
345
describe('isTestFile', () => {

convex/llmEval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
* Check if a file path is a test file that should be excluded from security scanning.
2121
* Test files often contain malicious code patterns for testing purposes (e.g., security skills).
2222
*/
23-
function isTestFile(path: string): boolean {
23+
export function isTestFile(path: string): boolean {
2424
const lower = path.toLowerCase()
2525

2626
// Common test file patterns

0 commit comments

Comments
 (0)