Refactor ClientConfigBuilder.build#1498
Refactor ClientConfigBuilder.build#1498cbrzn merged 13 commits intopileks/refactor-client-updatesfrom
ClientConfigBuilder.build#1498Conversation
cbrzn
left a comment
There was a problem hiding this comment.
I am a bit confused with the legacy folder, at first, I guess this is temporary, but how the long-term solution would look like?
| ); | ||
| expect(clientConfig.resolvers).toStrictEqual([testUriResolver]); | ||
|
|
||
| // TODO: How to test resolver? |
There was a problem hiding this comment.
We should not test that the resolver works here but that it can be added/removed and the object will be as expected. The resolver itself can be tested in the client (If I understand things correctly)
There was a problem hiding this comment.
Yup, that's my conclusion as well. However, CoreClientConfig only has an opaque resolver which cannot be tested structurally with something like shouldEqual.
I'm approaching this now by having the ClientConfigBuilder be able to "spit out" its _config object so that its structure can be tested.
I'm honestly not sure. It's not "legacy" per se, but it's there to support all the various forms of client config objects that we had in the past. The "non-legacy" approach is simply using |
This PR aims to refactor out all unnecessary elements of the
client-config-builderpackage, and defined what I saw as a "legacy" config for the PolywrapClient.Generally inspired by @krisbitney's comments on #1480 with some additional cleanup.
Remaining work:
ClientConfigBuildernow that it only outputsCoreClientConfig.