fix(ci): isolate mock.module tests per-file to prevent cross-contamination

This commit is contained in:
YeonGyu-Kim
2026-04-08 17:30:43 +09:00
parent 85fa939051
commit 70955b2b97
-6
View File
@@ -29,15 +29,9 @@ async function usesModuleMock(rootDirectory: string, testFile: string): Promise<
} }
function toIsolatedTarget(testFile: string): string { function toIsolatedTarget(testFile: string): string {
const pathSegments = testFile.split("/")
if (pathSegments.length <= 3) {
return testFile return testFile
} }
return pathSegments.slice(0, -1).join("/")
}
function isCoveredByTarget(testFile: string, isolatedTarget: string): boolean { function isCoveredByTarget(testFile: string, isolatedTarget: string): boolean {
return testFile === isolatedTarget || testFile.startsWith(`${isolatedTarget}/`) return testFile === isolatedTarget || testFile.startsWith(`${isolatedTarget}/`)
} }