Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@GrahamS-Quartech
Copy link
Contributor

🎯 Summary

PIMS-419

Routes and controllers for the parcels endpoints were added. All responses are merely stubs for now.
Tests were also added for the controller, as well as some rudimentary unit tests.
I've taken the liberty of adding a couple additional packages in this PR.
Faker is for automatically generating mock data for testing.
Sinon is to assist in stubbing and faking functionality outside of individual tests, which is useful for factory type classes and functions that are going to be reused and reset over and over again. That's why I've incorporated it into the mockRequest and mock Response.

Please see the comments I've added for some additional thoughts.

🔰 Checklist

  • [x ] I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

@qlty-cloud-legacy
Copy link

qlty-cloud-legacy bot commented Dec 21, 2023

Code Climate has analyzed commit a8569ad and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 91.1% (50% is the threshold).

This pull request will bring the total coverage in the repository to 97.2%.

View more on Code Climate.

Copy link
Collaborator

@dbarkowsky dbarkowsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Happy to see a standardized mocking for requests and responses.

Noted one thing not specific to this PR:
We might have an issue with the swagger-autogen. It worked fine for /health, but it hasn't picked up the comments in any additional routes. It also doesn't seem to interpret string literals.
image

Another thing for the future:
We should think about whether all the PUT requests should really be PUT or if they'd be more accurate as PATCH. Easy to change later depending on how they get implemented.

@GrahamS-Quartech GrahamS-Quartech merged commit 7b1150c into main Dec 22, 2023
@GrahamS-Quartech GrahamS-Quartech deleted the PIMS419-Parcels branch December 22, 2023 19:17
TaylorFries pushed a commit that referenced this pull request Jan 3, 2024
Co-authored-by: dbarkowsky <[email protected]>
Co-authored-by: Dylan Barkowsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants