mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-08-28 05:25:25 +00:00
Merge 9e5c3a7b3e into 0f793558ad
This commit is contained in:
commit
730fcce4e0
2 changed files with 30 additions and 1 deletions
|
|
@ -176,10 +176,15 @@ export function isTestFile(filePath: string): boolean {
|
|||
p.includes('.spec.') ||
|
||||
p.includes('__tests__/') ||
|
||||
p.includes('__mocks__/') ||
|
||||
// Generic test folders
|
||||
// Generic test folders. Repo-relative paths can start with these folders.
|
||||
p.startsWith('test/') ||
|
||||
p.startsWith('tests/') ||
|
||||
p.startsWith('testing/') ||
|
||||
p.includes('/test/') ||
|
||||
p.includes('/tests/') ||
|
||||
p.includes('/testing/') ||
|
||||
// Dart/Flutter test pattern
|
||||
p.endsWith('_test.dart') ||
|
||||
// Python test patterns
|
||||
p.endsWith('_test.py') ||
|
||||
p.includes('/test_') ||
|
||||
|
|
|
|||
24
gitnexus/test/unit/entry-point-scoring-dart-tests.test.ts
Normal file
24
gitnexus/test/unit/entry-point-scoring-dart-tests.test.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
import { isTestFile } from '../../src/core/ingestion/entry-point-scoring.js';
|
||||
|
||||
describe('isTestFile Dart and repo-relative test paths', () => {
|
||||
it.each([
|
||||
'test/pages/dashboard_page_test.dart',
|
||||
'test/integration/helper.dart',
|
||||
'lib/widgets/profile_card_test.dart',
|
||||
'tests/process_flow.dart',
|
||||
])('recognizes %s as test code', (filePath) => {
|
||||
expect(isTestFile(filePath)).toBe(true);
|
||||
});
|
||||
|
||||
it('recognizes Windows-style repo-relative Dart test paths', () => {
|
||||
expect(isTestFile('test\\pages\\dashboard_page_test.dart')).toBe(true);
|
||||
});
|
||||
|
||||
it.each(['lib/widgets/profile_card.dart', 'src/main.dart', 'src/testing_helpers.dart'])(
|
||||
'does not classify %s as test code',
|
||||
(filePath) => {
|
||||
expect(isTestFile(filePath)).toBe(false);
|
||||
},
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue