Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mock WeatherProvider #59

Merged
merged 3 commits into from Jun 10, 2019

Conversation

Projects
None yet
3 participants
@Derpthemeus
Copy link
Member

commented Jun 6, 2019

This will allow us to write tests that decouple adjustment method logic from WeatherProvider logic.

@Derpthemeus Derpthemeus changed the base branch from master to dev Jun 6, 2019

@salbahra

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

Instead of putting this along side our other providers, could we put this inside of .spec.ts file? That way it's only used for testing purposes? Or do we need it to run as a module?

@Derpthemeus

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2019

Sure, I'll move it into weather.spec.ts

@PeteBa

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

Does this allow for mocking just one return value. I would want to be able to supply an array of observations that the mock iterates along with each call e.g. a day's worth of weather data. I can look at this as a separate PR if not in scope here.

@Derpthemeus

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2019

It only allows you to specify a single return value for each method (getWeatherData and getWateringData) and that data will be returned regardless of the current data or coordinates specified. If you want to use multiple pairs of times and coordinates, you can make a new WeatherProvider for each one

@salbahra

This comment has been minimized.

Copy link
Member

commented Jun 9, 2019

Do you mind resolving the merge conflict? I can merge this is once that's done.

@Derpthemeus Derpthemeus merged commit 84dc82c into OpenSprinkler:dev Jun 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Derpthemeus Derpthemeus deleted the Derpthemeus:add-mock-weather-provider branch Jun 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.