Skip to content

Commit b06dc2a

Browse files
authored
fix: simplify getting testUtilsReferences (#14529)
1 parent 81cc9f0 commit b06dc2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/buildTs.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ packagesWithTs.forEach(({packageDir, pkg}) => {
116116
const tsConfig = JSON.parse(
117117
stripJsonComments(fs.readFileSync(tsConfigPath, 'utf8')),
118118
);
119-
const references = tsConfig.references.map(({path}) => path);
120119

121-
return references.some(reference => /test-utils$/.test(reference));
120+
return tsConfig.references.some(
121+
({path}) => path && path.endsWith('test-utils'),
122+
);
122123
});
123124

124125
if (hasJestTestUtils && testUtilsReferences.length === 0) {

0 commit comments

Comments
 (0)