| | |
| | | Object.defineProperty(exports, '__esModule', { |
| | | value: true |
| | | }); |
| | | exports.default = void 0; |
| | | exports.default = resolveConfigPath; |
| | | |
| | | function path() { |
| | | const data = _interopRequireWildcard(require('path')); |
| | |
| | | |
| | | const getConfigFilename = ext => _constants.JEST_CONFIG_BASE_NAME + ext; |
| | | |
| | | var _default = (pathToResolve, cwd, skipMultipleConfigWarning = false) => { |
| | | function resolveConfigPath( |
| | | pathToResolve, |
| | | cwd, |
| | | skipMultipleConfigWarning = false |
| | | ) { |
| | | if (!path().isAbsolute(cwd)) { |
| | | throw new Error(`"cwd" must be an absolute path. cwd: ${cwd}`); |
| | | } |
| | |
| | | // e.g. |
| | | // With a directory structure like this: |
| | | // my_project/ |
| | | // packcage.json |
| | | // package.json |
| | | // |
| | | // Passing a `my_project/some_directory_that_doesnt_exist` as a project |
| | | // name will resolve into a (possibly empty) `my_project/package.json` and |
| | |
| | | |
| | | if (!fs().existsSync(absolutePath)) { |
| | | throw new Error( |
| | | `Can't find a root directory while resolving a config file path.\n` + |
| | | "Can't find a root directory while resolving a config file path.\n" + |
| | | `Provided path to resolve: ${pathToResolve}\n` + |
| | | `cwd: ${cwd}` |
| | | ); |
| | |
| | | cwd, |
| | | skipMultipleConfigWarning |
| | | ); |
| | | }; |
| | | |
| | | exports.default = _default; |
| | | } |
| | | |
| | | const resolveConfigPathByTraversing = ( |
| | | pathToResolve, |