gdirk07 / PokemonChecker

Playing around with APIs
https://gdirk07.github.io/PokemonChecker/
0 stars 0 forks source link

Add service layer unit tests #78

Open jeremy-jtlo opened 2 years ago

jeremy-jtlo commented 2 years ago

Noticed while approving PRs last night that we don't have any tests for the following files:

Considering how core they are to our data pipeline, maybe we should at least have a couple quick sanity checks on them to ensure future changes don't break the app.

Services are guarantors of data consumed by views. The views will always trust that something coming from the service is valid and up-to-date, so we should be validating that.

Repositories are simple CRUD objects, but services need to make sure that what was placed in there has a valid expiry that can be relied on.

Factories do the work of hammering raw payloads into the shape our app can recognize. They need to be tested.

gdirk07 commented 2 years ago

I'm going to try and work on some of these one by one (focusing on abilities since that's my end-to-end feature) and create Pull Requests, we should discuss any other possible tests that should be create before we consider merging the pull requests

jeremy-jtlo commented 2 years ago

Crap, I just realized there are pokemon repository improvements I want to make.

Those may block the repo tests at the very least.

gdirk07 commented 2 years ago

You can make a new issue for that and then add tests to it to verify that it works