onlineStore icon indicating copy to clipboard operation
onlineStore copied to clipboard

added unit test

Open rudrikasharma15 opened this issue 1 year ago • 0 comments

Added Unit Test for GET /api/users Route This PR adds a Jest-based unit test for the GET /api/users route using supertest. It mocks the userService.getUsers() method to ensure the controller behaves correctly.

Changes made: Added a test in server/test/controller/User.test.js

Used jest.spyOn to mock service call

Verified response body and status code

Notes: Confirmed the test passes (npm test) Set up Jest + Supertest locally

Happy to add more test cases or refactor based on feedback! 💪

rudrikasharma15 avatar Jul 02 '25 15:07 rudrikasharma15