|
1 | 1 | 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' |
32 | 3 |
|
33 | 4 | describe('llmEval test file filtering', () => { |
34 | 5 | describe('isTestFile', () => { |
|
0 commit comments