cd backend npm install -D vitest supertest
Please add this test script to your package.json:
Context: Ensure the Task controllers you just wrote are bulletproof.
Primary Task: Create backend/tests/tasks.api.test.ts.
Specific Test Cases:
Privacy: If User A tries to GET /task/get-task/[UserB_ID], the API must return a 403 Forbidden or 404 Not Found.
Validation: Ensure a task cannot be created without a title or with an invalid status (must be 'to-do', 'in-progress', or 'complete').
Cleanup: Verify that DELETE /task/delete-task/:id actually removes the record from the collection.
cd backend npm install -D vitest supertestPlease add this test script to your package.json:
Context: Ensure the Task controllers you just wrote are bulletproof.
Primary Task: Create backend/tests/tasks.api.test.ts.
Specific Test Cases:
Privacy: If User A tries to GET /task/get-task/[UserB_ID], the API must return a 403 Forbidden or 404 Not Found.
Validation: Ensure a task cannot be created without a title or with an invalid status (must be 'to-do', 'in-progress', or 'complete').
Cleanup: Verify that DELETE /task/delete-task/:id actually removes the record from the collection.