Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(testing): allow custom address for local registry (#29050)
… output<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> The `startLocalRegistry()` always assumed that the local registry was started on `localhost` , which is not necessary the case, if for example user has set the `listenAddress` option in the underlying `verdaccio executor` or via the `verdaccio config file`https://github.com/nrwl/nx/blob/128778e7d1a8d7f2b078b2401d47270c0c15a2ce/packages/js/src/executors/verdaccio/verdaccio.impl.ts#L130 As a result the `startLocalregistry()`, will never return as, it is waiting forever to detect the local registry URL in the process output: https://github.com/nrwl/nx/blob/128778e7d1a8d7f2b078b2401d47270c0c15a2ce/packages/js/src/plugins/jest/start-local-registry.ts#L40 This customization of `verdaccio` listen address is something required, namely when running within a **devcontainer**. In that case, the address must be set to `0.0.0.0`, so that the registry can be accessed from `http://localhost:4873` from host machine. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Allow customizing the `listenAddress` when starting the local registry, via an additional option that can be provided when calling the method. It default value will be `localhost`. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #28238
- Loading branch information