This pull request introduces a new endpoint /books/category/:categoryName for fetching books by their category. It also sets up testing for this new feature using Jest and Supertest, ensuring the endpoint behaves as expected under various scenarios.
Summary
Added jest and supertest to package.json for testing purposes.
Created a new test file tests/books.test.js to cover the new endpoint functionality.
Tests include checking for a successful response with an array of books for existing categories.
Tests for receiving a 404 status code and an appropriate error message when querying non-existent or invalid categories.
Ensured the database connection is properly set up and torn down before and after tests using mongoose.
Fixes #63.
🎉 Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback (click)
Description
This pull request introduces a new endpoint
/books/category/:categoryName
for fetching books by their category. It also sets up testing for this new feature using Jest and Supertest, ensuring the endpoint behaves as expected under various scenarios.Summary
jest
andsupertest
topackage.json
for testing purposes.tests/books.test.js
to cover the new endpoint functionality.mongoose
.Fixes #63.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.