fix(reference): classify test suffixes before extensions

This commit is contained in:
Kaoru0822
2026-10-05 23:56:24 -07:00
parent b6c21b1db5
commit 8b228ae701
3 changed files with 167 additions and 1 deletions
+2 -1
View File
@@ -285,7 +285,8 @@ const filenameIsTest = (filename: string): boolean => {
if (lower.includes(".test.") || lower.includes(".spec.")) return true;
if (lower.startsWith("test_") || lower.startsWith("spec_")) return true;
if (lower.endsWith("_test") || lower.endsWith("_spec")) return true;
return false;
const stem = basenameParts(lower).base;
return stem.endsWith("_test") || stem.endsWith("_spec");
};
const filenameIsGenerated = (filename: string): boolean => {