test: setup supertest and initial server tests #263#308
Merged
leandrumartin merged 1 commit intooss-slu:mainfrom Mar 5, 2026
Merged
test: setup supertest and initial server tests #263#308leandrumartin merged 1 commit intooss-slu:mainfrom
leandrumartin merged 1 commit intooss-slu:mainfrom
Conversation
leandrumartin
approved these changes
Mar 5, 2026
Collaborator
leandrumartin
left a comment
There was a problem hiding this comment.
Looks good. Thank you for your contribution!
Contributor
Author
|
Thank you for the opportunity to collaborate 🙏✌ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Summary
@leandrumartin 🙏
Closes #xxx
A brief description/summary of your PR here. What does it add? Why is it necessary? How was the change made, and how was it tested?
This pull request sets up the initial unit testing infrastructure for the boneset-api server. It adds supertest as a development dependency and creates the first test file (server.test.js) to verify the root endpoint. This is necessary to lay the foundation for future endpoint testing.
Screenshots
This is the screenshot of the tests:

If applicable, add screenshots showing the before and after of any UI changes made.
PR Checklist
Detailed Description
A more detailed description and any additional information.
I made the following changes:
Dependency: I added supertest to the devDependencies in package.json.
Test syntax: I was confused here and opted to use CommonJS (require) instead of ES Modules (import) to ensure compatibility with the existing server.js architecture and avoid refactoring the entire backend. But if you need to make that change, let me know and I'll do it.
Testing tests with npx: I noticed there wasn't a script to run tests, so I had to manually configure it using npx jest server.test.js. However, if you'd like, let me know and I'll add the script to run the tests.
I was considering making the type="module" changes and implementing the test script, but it's better to complete the specific task you assigned me first, and then you can allow me to make those changes.
And finally, a technical note: The message "Cannot log after tests are done". This is a known side effect of the asynchronous
initializeSearchCache()function inserver.js, which terminates after testing. Since the tests themselves passed (2/2) and I didn't want to modify the core server logic, I left it as is for this pull request.