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

Added Unit tests for backend/routes/itemRoutes.js using jest, mockingoose and supertest #258

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Amend37
Copy link
Contributor

@Amend37 Amend37 commented Feb 24, 2025

Developer: Anthony Mendoza

Pull Request Summary

Added Unit tests for backend/routes/itemRoutes.js using jest, mockingoose and supertest. Decided to use supertest as well because it made it easier to test and I read online it also helps to not miss some integration points where middleware or Express-specific behavior could cause issues.

Make sure to npm i and to run do npm test

Pull Request Checklist

  • [x ] Code is neat, readable, and works
  • [x ] Comments are appropriate
  • [ x] The commit messages follows our guidelines
  • [x ] The developer name is specified
  • [x ] The summary is completed
  • [x ] Ask for a review in communication channels

Reviewer Checklist - PULL REQUEST REVIEWER ONLY

IMPORTANT: The rest of the sections in this checklist should only be filled out by authorized pull request reviewers. If you are the individual contributor, do not fill out the rest of the fields or check the boxes.

Reviewer: Full Name

NOTE: Pull requests should only be merged when all boxes are checked.

  • Assign yourself as reviewer if not assigned
  • The reviewer name is specified
  • The code is fully reviewed
  • Meaningful feedback is given
  • Let developer know a review has been made

@peterchinh
Copy link
Contributor

Can you add --coverage-report to the test script in package.json. Also, try to add tests for all the requests and achieve a higher coverage for itemRoutes.js if you can.

@Amend37
Copy link
Contributor Author

Amend37 commented Feb 28, 2025

added more coverage and most of it is covered although it seems i need to do more testing for the %Branch but decided to focus a little more on the newer task since we have to demo this coming week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants