Renames the implementation function from findAverageStepCount to findStepGoalAverage for clarity
Adds toFixed(2) to the function so that it returns a rounded string instead of a number with > 2 decimal places
Adds a test for the findStepGoalAverage function
Minor formatting tweaks
Contributors
@ericahagle / @tenthwalker
Notes
I thought about writing a test to check if the data returned a user that didn't include a dailyStepGoal, but that would require some more reworking of the function itself, and none of the objects in the API return exclude that property. So, this seemed like a little too much extra work at this point. But we could revisit it if we have more time at the end of the project and want to refactor.
Checklist
[x] My PR has an appropriately descriptive and concise title.
[x] My PR denotes any/all team members who contributed to it.
[x] My code follows the Turing Style Guides and best practices.
[x] I ran the code locally and verified that there are no visible errors.
[x] fix: My PR clearly describes what bug I'm fixing and why. (if applicable)
[x] test: My PR clearly describes what tests I'm adding/updating and why. (if applicable)
Description
findAverageStepCount
tofindStepGoalAverage
for claritytoFixed(2)
to the function so that it returns a rounded string instead of a number with > 2 decimal placesfindStepGoalAverage
functionContributors
@ericahagle / @tenthwalker
Notes
I thought about writing a test to check if the data returned a user that didn't include a
dailyStepGoal
, but that would require some more reworking of the function itself, and none of the objects in the API return exclude that property. So, this seemed like a little too much extra work at this point. But we could revisit it if we have more time at the end of the project and want to refactor.Checklist