fix: simplify getting testUtilsReferences (#14529)

This commit is contained in:
Mikhail
2023-09-18 16:19:32 +02:00
committed by GitHub
parent 38c2d658df
commit 87fd468761
+3 -2
View File
@@ -116,9 +116,10 @@ packagesWithTs.forEach(({packageDir, pkg}) => {
const tsConfig = JSON.parse(
stripJsonComments(fs.readFileSync(tsConfigPath, 'utf8')),
);
const references = tsConfig.references.map(({path}) => path);
return references.some(reference => /test-utils$/.test(reference));
return tsConfig.references.some(
({path}) => path && path.endsWith('test-utils'),
);
});
if (hasJestTestUtils && testUtilsReferences.length === 0) {