function pathJoin(...parts) {
  if (path.isAbsolute(parts[0])) {
    return path.join(...parts);
  }
  return "." + path.sep + path.join(...parts);
}
Jest changes __dirname to relative path and the require of relative path
that doesn't start with "." will be a module require -

require("./packages/babel-plugin...") vs require("packages/babel-plugin..");

So we start the path with a "./"