Skip to content

Conversation

@alaatamam
Copy link

…Service, and fix lint errors

  • Added comprehensive tests for AnthologyController GET endpoints (findOne, findAll, getStories)
  • Mocked AuthService and UsersService in AuthController tests to resolve dependency injection errors
  • Fixed ESLint no-explicit-any errors in Anthology tests by replacing 'as any' with type-safe casts
  • Verified all backend test suites pass successfully and all lint checks are clean

ℹ️ Issue

Closes #18

📝 Description

This PR improves backend test reliability and coverage across both the AuthController and AnthologyController.
Previously, tests for the Auth module were failing due to missing provider dependencies (AuthService, UsersService), and the Anthology test suite contained any-type usage that triggered lint errors. These changes ensure both modules are fully covered, type-safe, and compliant with the NestJS testing framework.

Briefly list the changes made to the code:

  1. Added GET endpoint tests for AnthologyController (findOne, findAll, getStories).
  2. Mocked AuthService and UsersService in AuthController tests to resolve dependency injection errors.
  3. Removed all any-type casts and replaced with type-safe equivalents.
  4. Verified all backend test suites and lint checks now pass successfully.

✔️ Verification

Added 10 tests to anthology.controller.spec.ts to verify success of endpoint. All tests passed.

Provide screenshots of any new components, styling changes, or pages.

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

…Service, and fix lint errors

- Added comprehensive tests for AnthologyController GET endpoints (findOne, findAll, getStories)
- Mocked AuthService and UsersService in AuthController tests to resolve dependency injection errors
- Fixed ESLint no-explicit-any errors in Anthology tests by replacing 'as any' with type-safe casts
- Verified all backend test suites pass successfully and all lint checks are clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET endpoint for retrieving all stories in an anthology

1 participant