testDir = parts => {
    if (parts.length === 0) {
      return null;
    }

    const fullPath = path.join(root, parts.join(path.sep));

    var exists = fs.existsSync(path.join(fullPath, filename));
    return exists ? fullPath : testDir(parts.slice(0, -1));
  }
Module capable of getting the configuration out of a given file.

The function will return all the default configuration, as specified by the
`DEFAULT` param overriden by those found on `rn-cli.config.js` files, if any. If no
default config is provided and no configuration can be found in the directory
hierarchy, an error will be thrown.