Skip to content

Kyle: Backend Task CRUD Testing #4

@kn-dev-code

Description

@kn-dev-code
Image

cd backend npm install -D vitest supertest

Please add this test script to your package.json:

Image

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions