Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App.js backend testing #132

Merged
merged 4 commits into from
Apr 23, 2024
Merged

App.js backend testing #132

merged 4 commits into from
Apr 23, 2024

Conversation

FernFinder
Copy link
Contributor

@FernFinder FernFinder commented Apr 23, 2024

Overview

  • This pull request increases coverage of the backend app.js file to 100%.

Related Issue(s)

Added

  • New file backend/tests/app.test.js has unit tests for the entire app.js file.
  • New file backend/tests/connectdb.test.js has a unit test for testing database connection

Changes

  • backend/app.js has been slightly modified so that the error handler is simpler.

Screenshots

image

Instructions for Testing

  • Run npm run coverage on backend.

Checklist before Merging

  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate).
  • I have ensured the changes adhere to the project's coding standards and guidelines.

@FernFinder FernFinder changed the title Apptests App.js backend testing Apr 23, 2024
Copy link
Contributor

@dusek2 dusek2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Review

  • Readability:
    Clear organization of tests and effective use of stubs to isolate functionality.

  • Code Quality:
    Simplification of error handling enhances clarity; thorough unit testing is in place.

  • Testing:
    All relevant app.js routes were tested, achieving great coverage, including edge cases.

  • Functionality:
    Error handling improvements should enhance user experience during failures.

  • Housekeeping:
    Comprehensive tests were added for app.js and database connectivity, adhering to best practices.

Additional Comments:

Consider double-checking the undefined status in the database connection failure test for accuracy.

This puts us over 70% on coverage!

Copy link
Contributor

@Alexmc567 Alexmc567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Review:

  • Readability: Good description and well documented.

  • Code Quality: Code appears to be of high quality and is consistent with the project.

  • Testing: Testing instructions provided. Tests do work and increase coverage.

  • Functionality: Adds tests that appear to function correctly.

  • Housekeeping: No junk files, & lots of comments. No AI use mentioned. Great addition!

@FernFinder FernFinder merged commit 3cc2062 into UNLV-CS472-672:main Apr 23, 2024
1 check passed
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.

3 participants