(a: string, b: string)
| 146 | } |
| 147 | |
| 148 | function sameDirectory(a: string, b: string): boolean { |
| 149 | const dirA = a.lastIndexOf("/"); |
| 150 | const dirB = b.lastIndexOf("/"); |
| 151 | if (dirA === -1 && dirB === -1) return true; |
| 152 | return a.slice(0, dirA) === b.slice(0, dirB); |
| 153 | } |
| 154 | |
| 155 | function isTestFile(filePath: string): boolean { |
| 156 | return /(?:test|spec|__tests__|_test\.|\.test\.|\.spec\.)/i.test(filePath); |