Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = (moduleName, options) => {
const resolvedPath = resolver(moduleName, options);
if (
ReactTestVersion &&
['react', 'react-dom', 'react-test-renderer'].some(p =>
resolvedPath.includes('node_modules/${}/')
) &&
!resolvedPath.includes('react-versions/react')
) {
return resolvedPath.replace(
'node_modules/',
`react-versions/react-${ReactTestVersion}/node_modules/`
);
}
return resolvedPath;
};