How to use the jest-resolve/build/defaultResolver.js function in jest-resolve

To help you get started, we’ve selected a few jest-resolve examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesmfriedman / rmwc / scripts / jest-resolver.js View on Github external
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;
};

jest-resolve

MIT
Latest version published 1 year ago

Package Health Score

88 / 100
Full package analysis

Similar packages