Conversation
📝 HackYourFuture auto gradeAssignment Score: 100 / 100 ✅Status: ✅ Passed Test Details |
There was a problem hiding this comment.
Pull request overview
Implements the remaining Post Central CLI service functions and aligns tests/output artifacts with the completed behavior (notably, DELETE endpoints now parsing JSON responses), while also completing the cocktail markdown generator output for task 1.
Changes:
- Implemented
getMe,loginUser,createPost,getPosts,updatePost,deleteUser, anddeletePostinpost-cliservices. - Updated CRUD tests’ fetch mocks to include
json()for DELETE responses. - Added generated
margarita.mdoutput for the cocktail recipe task.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| task-2/post-cli/src/services.js | Adds full CRUD+auth service implementations and switches BASE_URL between test vs non-test runtime. |
| task-2/post-cli/tests/test-crud.test.js | Ensures mocked fetch responses include json() where the service now expects it. |
| task-1/cocktail.js | Implements fetching, formatting, and writing markdown output for cocktail recipes. |
| task-1/output/margarita.md | Adds the generated markdown output file for the margarita query. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -1,5 +1,7 @@ | |||
| // Change base URL for API requests to the local IP of the Post Central API server | |||
| const BASE_URL = 'http://localhost:3000'; | |||
| // In the app, use the public API as the updated requairement. In tests, use localhost because tests check for localhost URLs. | |||
| const BASE_URL = process.env.VITEST | ||
| ? 'http://localhost:3000' | ||
| : 'https://postcentral.hyf.dev'; |
There was a problem hiding this comment.
When I posted my message in Slack that you could use the public API as alternative I didn't take into account that the test requires the local API url. You solved it here by making the URL conditional on the presence of the VITEST environment variable. Very good if you did this completely yourself. Still good if AI helped you a bit.
No description provided.