gitfrosh / lotr-api

This repository holds the code base of the API to rule them all, the Lord of the Rings api, which provides you with book, character, movie and quotes data.
https://the-one-api.dev
238 stars 66 forks source link

feat: Add some backend tests #66

Closed MateuszKikmunter closed 2 years ago

MateuszKikmunter commented 2 years ago

I added unit tests for the backend. Now we have all controllers, most of the helpers and all middleware tested. Additionally I also removed some unsed code and files and made some refactoring to make the code more modern. Next step would be to add some integration tests to be fully covered. (I can work on that too if you agree @gitfrosh )

EddieEldridge commented 2 years ago

Had a quick look and all goods to me. This will be very helpful. If I had any feedback it would be

MateuszKikmunter commented 2 years ago

Had a quick look and all goods to me. This will be very helpful. If I had any feedback it would be

  • Move tests into their own dedicated folder (personal preference)
  • Add some documentation on how to run the tests to the README
  • Update package.json with the correct command to run the tests (if the existing one doesnt do it already)

Thanks for input @EddieEldridge !

MateuszKikmunter commented 2 years ago

Please review and merge if all good @gitfrosh. I’ll move to the next issue afterwards. 😊

EddieEldridge commented 2 years ago

Any chance this could get merged? It looks good to me and there's a few other bits I would like to work on using this functionality. Thanks.

MateuszKikmunter commented 2 years ago

Any chance this could get merged? It looks good to me and there's a few other bits I would like to work on using this functionality. Thanks.

Same here. There are few things I’d like to take a look at after this PR is merged.

gitfrosh commented 2 years ago

Thank you @MateuszKikmunter and @EddieEldridge, for your contributions and reminders regarding the pull request! Finally, a proper test setup for the API 👍🏻 I'll merge this now, and you're very welcome to proceed with your work.