This is my solution for the “The Untested API” take‑home assignment for the Full Stack Developer Intern position at Underpin Services.
The project is a small Task Manager API built with Node.js and Express, using an in‑memory data store and tested with Jest and Supertest.
Prerequisites: Node.js 18+
cd task-api
npm install
npm start # runs on http://localhost:3000Tests:
npm test # run test suite
npm run coverage # run tests with coverage reportThe main endpoints exposed by the API are:
GET /tasks– list all tasks, with optional?status=,?page=,?limit=query parametersPOST /tasks– create a new taskPUT /tasks/:id– full update of a taskDELETE /tasks/:id– delete a task (returns 204 on success)PATCH /tasks/:id/complete– mark a task as completeGET /tasks/stats– return counts by status and overdue tasksPATCH /tasks/:id/assign– assign a task to a user (implemented in this solution)
Task objects follow the shape described in the original assignment (id, title, description, status, priority, dueDate, completedAt, createdAt).
- Business logic and storage:
src/services/taskService.js - HTTP routes:
src/routes/tasks.js - Validation helpers:
src/utils/validators.js - App setup / middleware:
src/app.js - Tests: under
tests/servicesandtests/routes
I focused on:
- Adding unit tests for the service layer and integration tests for the routes.
- Achieving >90% coverage to comfortably exceed the 80% target.
- Implementing the new
PATCH /tasks/:id/assignendpoint with input validation and tests.
- Tests and coverage: see
NOTES.mdfor the coverage summary (Statements ≈ 93%, Branches ≈ 84.5%, Functions ≈ 93.5%, Lines ≈ 92.6%) and what I would test next. - Bug report and fixes: see
BUG_REPORT.mdfor details of the issues I identified (e.g. pagination offset) and the fix I implemented ingetPaginated. - New feature:
PATCH /tasks/:id/assignis implemented with validation (assigneemust be a non‑empty string), proper 404 handling for missing tasks, and tests at both service and route level.
-
Clone the repository:
git clone https://github.com/AnkitDimri4/Take-Home-Assignment-The-Untested-API.git cd Take-Home-Assignment-The-Untested-API/task-api -
Install dependencies and run the tests:
npm install npm test npm run coverage -
Check:
BUG_REPORT.mdfor identified bugs and the fix.NOTES.mdfor coverage numbers, additional test ideas, surprises, and questions I would raise before production.
For convenience, the API is also deployed on Render:
Example requests:
GET https://take-home-assignment-the-untested-api-1qkg.onrender.com/tasksGET https://take-home-assignment-the-untested-api-1qkg.onrender.com/tasks/stats
Ankit Dimri
Full‑Stack & AI Developer
GitHub: