martin-markovic / learn-connect

Multi-feature platform designed to enhance the online learning experience.
MIT License
0 stars 0 forks source link

Quizzes #9

Closed martin-markovic closed 2 months ago

martin-markovic commented 2 months ago

Summary

This pull request focuses on fixing typos, updating configurations, and enhancing the mock testing framework for better modularity and coverage.

Changes

  1. Bug Fixes:

    • Fixed import name typo in quizController.js.
    • Fixed typos in README.md.
  2. Configuration Updates:

    • Changed JWT expiresIn property to 1 day in userController.js.
    • Removed redundant configuration from mockServer.js.
  3. Mock Data and Controllers:

    • Implemented mockDatabase.js to provide testing data.
    • Removed redundant class methods in mockDatabase.js.
    • Implemented mock controller functions in mockQuizController.js.
    • Integrated mock controllers into matching API endpoints in mockQuizRoutes.js.
  4. Testing Enhancements:

    • Integrated request, expect, createMockServer.js, mockQuizRoutes, and testDB into quizUnit.test.js.
    • Added initial response unit tests to controller functions in quizUnit.test.js.
    • Integrated mockToken authorization to HTTP requests in quizUnit.test.js.
    • Implemented token validation based on user ID in mockMiddleware.js.
    • Integrated mockProtect middleware to all routes in mockQuizRoutes.js.

Testing

Additional Information