[ResponseOps] allow Slack API URL to be overridden for functional tests #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not intended to be merged directly
Summary
This is part of the effort to get the Slack API functional tests going. For that, we need to allow
the Slack API URL, which before was hard-coded, to be updated so that it can be set to point to
the Slack API simulator server we will eventually create.
I first tried making this a config setting for
stack_connectors
- but I could see that was going to be messy - we'd have to know the port of the server before actually starting the functional test server, which starts the server simulators. But ... the port may end up being determined dynamically, so ... there's no way to know it.I ended up making the URL updateable via a new function, removed the existing
const
of the value, and changed those references to use the new function which returns the updateable value -internalGetSlackApiURL()
.All we should have to do to start using this, is call the
internalSetSlackApiURL()
function with the URL of the slack API simulator, once we know it. I didn't expose the function any further up the directory tree, as I wasn't sure we would need to. Guessing we may, as we will have to call this from thex-pack/test
modules that create the slack API simulator.