* 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)
| 196 | * example below an unrelated production symbol. |
| 197 | */ |
| 198 | function 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. |