tools/bazel_rules/jest/jest-resolver.js
/**
 * Try to resolve a moduleId based on the module mappings that are created by bazel
 * @param {string} moduleId
 */
Try to resolve a moduleId based on the module mappings that are created by bazel
@param {string} moduleId
Try to resolve a moduleId based on the module mappings that are created by bazel @param { string } moduleId
function resolvePath(moduleId) {
  if (moduleMappings.has(moduleId)) {
    return resolveModuleFileName(moduleMappings.get(moduleId));
  }
  const item = [...moduleMappings.keys()].find((item) =>
    moduleId.startsWith(item),
  );
  if (item) {
    return resolveModuleFileName(
      moduleId.replace(item, moduleMappings.get(item)),
    );
  }
  return resolveModuleFileName(moduleId.replace('dynatrace/', ''));
}
function resolvePath ( moduleId ) { if ( moduleMappings . has ( moduleId ) ) { return resolveModuleFileName ( moduleMappings . get ( moduleId ) ) ; } const item = [ ... moduleMappings . keys ( ) ] . find ( ( item ) => moduleId . startsWith ( item ) , ) ; if ( item ) { return resolveModuleFileName ( moduleId . replace ( item , moduleMappings . get ( item ) ) , ) ; } return resolveModuleFileName ( moduleId . replace ( 'dynatrace/' , '' ) ) ; }
Try to resolve a moduleId based on the module mappings that are created by bazel
 @param {string} moduleId
Try to resolve a moduleId based on the module mappings that are created by bazel @param { string } moduleId
// If we cannot replace the file with a mapping then it might be inside a module without // module name so the moduleId will consist out of `dynatrace/path/to/module`