onlineStore
onlineStore copied to clipboard
added unit test
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! 💪