oss-slu / oss-slu/DigitalBoneBox
Server unit tests
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 18
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 4
Description
🎯 Goal / Objective
A clear and concise description of what this task aims to achieve. Why is this task important?
There are no automated tests for our server in boneset-api/server.js. Currently, our only way of validating the server's functionality is by manually running the site, and this can easily miss critical features.
✅ Tasks to be Completed
A checklist of the specific, actionable steps required to complete this issue. This helps track progress.
- Set up supertest as a dev dependency in
package.json - Set up a
tests/server.test.jsfile. It should have the following imports:import express from "express" import request from "supertest" - Write tests for each API endpoint. Test that calling the endpoints correctly return expected status and information, that failures return the expected status code, and any potential edge cases.
- Correct any failing tests.
See sub-issues for more details.
Acceptance Criteria
A checklist of conditions that must be met for this task to be considered complete. How will we verify that it's done correctly?
- Existing endpoints are well covered.
- The new feature is implemented as described.
- All related code passes the repository's workflow checks (linting, tests).
- The application runs without errors after the changes are made.
Additional Context
Add any other context, notes, screenshots, or links that might be helpful for completing this task.
See this file in another repository for an example of the kind of workflow we want. That will give you a quick idea of how to test the endpoints.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading boneset-api/server.js to inventory the existing endpoints, then inspect package.json and the repository workflow checks. Set up tests/server.test.js with the requested imports and use the endpoint behavior to define success, failure, and edge-case assertions. Done means the endpoints are covered, tests and linting pass, and the application still runs without errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, nodejs
- Domain
- api, backend, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100