From 6182fe12021d7d1e12673b4e4542f34f2fd4b483 Mon Sep 17 00:00:00 2001 From: Twisted_Arrow Date: Thu, 27 Aug 2026 08:25:05 +0530 Subject: [PATCH 1/2] fix(process): recognize repo-relative Dart test paths --- gitnexus/src/core/ingestion/entry-point-scoring.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gitnexus/src/core/ingestion/entry-point-scoring.ts b/gitnexus/src/core/ingestion/entry-point-scoring.ts index 58cf9389c..641c8da02 100644 --- a/gitnexus/src/core/ingestion/entry-point-scoring.ts +++ b/gitnexus/src/core/ingestion/entry-point-scoring.ts @@ -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_') || From 9e5c3a7b3e02ae12219bd87c4b75669b911c2b8d Mon Sep 17 00:00:00 2001 From: Twisted_Arrow Date: Thu, 27 Aug 2026 08:25:16 +0530 Subject: [PATCH 2/2] test(process): cover Dart test path detection --- .../entry-point-scoring-dart-tests.test.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gitnexus/test/unit/entry-point-scoring-dart-tests.test.ts diff --git a/gitnexus/test/unit/entry-point-scoring-dart-tests.test.ts b/gitnexus/test/unit/entry-point-scoring-dart-tests.test.ts new file mode 100644 index 000000000..485dd4caa --- /dev/null +++ b/gitnexus/test/unit/entry-point-scoring-dart-tests.test.ts @@ -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); + }, + ); +});