openmainframeproject / openmainframeproject/software-discovery-tool
[Feature]: Add test suite for backend
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 41
- Forks
- 50
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 3
Description
Problem statement
The backend/ (Node/Express API) currently has no test suite — no unit tests and no integration tests. This backend was recently migrated from Flask to Node/Express (#269), so the codebase is fresh and doesn't yet have test coverage. Without tests, regressions in API routes, database queries, or business logic can go unnoticed, especially as new contributors add features.
Proposed solution
Set up a test suite for the backend using a standard Node testing stack, for example:
- Jest (or Mocha + Chai) as the test runner/assertion library
- Supertest for HTTP/integration testing of Express routes
- Mock or test-database setup for DB-dependent tests
Suggested initial scope:
- Unit tests for utility/helper functions
- Integration tests for core API endpoints (e.g. search, distro data routes)
- Basic error-handling test cases (invalid input, DB failure, etc.)
- CI integration so tests run automatically on PRs
Acceptance Criteria
- Testing framework (Jest/Mocha) added to backend/package.json
- At least one test file per major route/controller
- npm test script added and documented in README
- Tests pass in CI on every PR
- Basic contributing note added on how to write/run backend tests
Alternatives considered
No response
Contributor guide
No contributing guide indexed for this repository
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 in backend/ by reading backend/package.json, the README, and the major route/controller entry points. Compare the proposed Jest or Mocha setup with the existing backend structure, then define unit, endpoint, error-handling, and CI coverage. Done means the package has a documented npm test command, route tests, contributing guidance, and tests passing on every PR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js
- Domain
- api, backend, ci-cd, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100