react-launch-darkly icon indicating copy to clipboard operation
react-launch-darkly copied to clipboard

Refactor lib/utils.js

Open jacobmoretti opened this issue 7 years ago • 2 comments

Refactor lib/utils.js by abstracting out each of the functions into separate files and placed under lib:

  • getLocation, I believe this was only added to allow easier mocking. We should be able to do away with this and fix the tests that relied on it.
  • ldClientWrapper -> ldClientWrapper.js
  • ldOverrideFlag -> ldOverrideFlag.js
  • getAllFeatureFlags -> getAllFeatureFlags.js

jacobmoretti avatar Oct 28 '17 00:10 jacobmoretti

I can help with this.

Is there a quick way to test any changes I make before I submit a pull request?

GarretLefler avatar Oct 29 '17 22:10 GarretLefler

@GarretLefler Thanks for offering to lend a hand with this issue! Unfortunately there isn't a great a way to do an end-to-end test without an account with LaunchDarkly. Its also part of the reason why https://github.com/TrueCar/react-launch-darkly/issues/16 hasn't been completed yet.

Feel free to submit your PR and use the unit-tests as the measurement for now. I'll do some testing of your changes on my end as well.

jacobmoretti avatar Oct 30 '17 16:10 jacobmoretti