MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isTestPath

Function isTestPath

src/ui-server/api/search.ts:198–204  ·  view source on GitHub ↗

* Deliberately a plain path check rather than the engine's `isTestFile`: this * is a ranking nudge inside one tier, and `isTestFile` also treats `examples/`, * `benchmarks/` and `fixtures/` as tests — pushing a legitimately-searched * example below an unrelated production symbol.

(filePath: string)

Source from the content-addressed store, hash-verified

196 * example below an unrelated production symbol.
197 */
198function isTestPath(filePath: string): boolean {
199 const lower = filePath.toLowerCase().replace(/\\/g, '/');
200 return (
201 /(^|\/)(tests?|specs?|__tests__)\//.test(lower) ||
202 /[._-](test|tests|spec|specs)\.[a-z0-9]+$/.test(lower)
203 );
204}
205
206/**
207 * The hard gate the `kind:` / `lang:` / `path:` / `name:` grammar asks for.

Callers 1

buildSearchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected