Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests/bugfixes for loadConfig (#1059)
- Fixed bug where a user specifies loading of a config with a flag, but if that file isn't found, it loads an `apollo.config.js`. - Ex: `apollo client:check --config=config/apollo.js` would also load `./apollo.config.js` if it couldn't find the specified config. I think if a user is _manually specifying_ a config, it should _only_ load what they specified and throw an error if not found. - This was preventing testing errors, since leaving off a config would just load this repo's config (which wouldn't work) - Removed the `getSearchPlaces` function. It was extraneous, and misleading. While `search places` is the term that dotenv uses, it is less descriptive than `defaultFileNames`, since that what the search places are–filenames. - Added `try/catch` around the cosmiconfig's loader, since it can throw on malformed files with an unhelpful error. - Handled case where `.env` is not a `File`, but a folder or something else. Resolves #1132 - Split up project type and service name setting, since those being intertwined added unnecessary complexity
- Loading branch information