What works and what doesn’t
/users/stats
that returns a JSON object with user count and average signup age. Use our existing users table in PostgreSQL. You can reference the /orders/stats
endpoint in statsController.js
for how we structure responses. Ensure the new endpoint is covered by the StatsController.test.js
suite.”UserProfileComponent
, add a dropdown that shows a list of user roles (admin, editor, viewer). Use the styling from DropdownBase
. When a role is selected, call the existing API to set the user role. Validate by checking that the selection updates the user role in the DB. Refer to your Knowledge for how to test properly.”UserService.test.js
as an example. After implementation, run npm test -- --coverage
and verify the coverage report shows >80% for both functions. Also confirm that tests pass with both valid and invalid credentials, and that logout properly clears session data.”UserService.test.js
), and a well-defined scope with specific verification steps.logger.js
from JavaScript to TypeScript. We already have a tsconfig.json
and a LoggerTest.test.js
suite for validation. Make sure it compiles without errors and make sure not to change the existing config! After migration, verify by: 1) running tsc
to confirm no type errors, 2) running the test suite with npm test LoggerTest.test.js
to ensure all tests pass, and 3) checking that all existing logger method calls throughout the codebase still work without type errors.”tsconfig.json
) and test suite for immediate feedback, plus specific compilation and validation steps.OrderModel
for how we do it in this codebase. After implementation, verify by: 1) running npm run test:integration UserModel.test.js
to check all integration tests pass, 2) confirming query performance hasn’t degraded by checking execution time on a test dataset of 1000 users, and 3) validating that all CRUD operations still maintain data integrity by running npm run test:e2e user-flows.test.js
.”OrderModel.js
). Provides a link to docs so Devin knows to reference them, and includes specific performance and functionality verification steps with exact test commands.