Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
collectCoverageFrom = collectCoverageFrom.reduce((patterns, filename) => {
if (
micromatch(
[replacePathSepForGlob(path.relative(options.rootDir, filename))],
newOptions.collectCoverageFrom!,
).length === 0
) {
return patterns;
}
return [...patterns, filename];
}, newOptions.collectCoverageFrom);
}
typeof project === 'string' ? glob(project) : [];
return projects.concat(globMatches.length ? globMatches : project);
}, [] as Array);
break;
case 'moduleDirectories':
case 'testMatch':
{
const replacedRootDirTags = _replaceRootDirTags(
escapeGlobCharacters(options.rootDir),
oldOptions[key],
);
if (replacedRootDirTags) {
value = Array.isArray(replacedRootDirTags)
? replacedRootDirTags.map(replacePathSepForGlob)
: replacePathSepForGlob(replacedRootDirTags);
} else {
value = replacedRootDirTags;
}
}
break;
case 'testRegex':
{
const option = oldOptions[key];
value = option
? (Array.isArray(option) ? option : [option]).map(
replacePathSepForRegex,
)
: [];
}
break;
case 'moduleFileExtensions': {