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

project 1 refactoring deep function calls #12

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

goelaine
Copy link

@goelaine goelaine commented Sep 19, 2024

Removed SonarCloud's warning about nested functions (fixes #447 ) by creating helper functions and calling them. Tested with lint/test and manually with console logs when interacting with UI. Edited file public/src/client/category/tools.js

This image shows my name printed in the console on my local instance of NodeBB. Steps to trigger the print statement:

  1. Log in to NodeBB as any user
  2. Navigate to Categories from menu
  3. Click on any of the forums (I clicked on 'announcements' in the image below)
Screenshot 2024-09-04 at 23 23 35

The file I refactored does not appear in the existing code coverage report. Although I attempted to write new test cases for the file, they were not compatible (npm run lint gave many errors), and I had no existing test cases to base my framework on.
I believe that the reason why my file is not included in the code coverage in the first place is because it is executed when the user interacts with it on the front end. A user's configuration and actions vary. Thus, it is difficult to write automated tests and is best to test these code snippets with manual testing, as I have completed.

@goelaine goelaine merged commit 9f15b82 into CMU-313:f24 Sep 19, 2024
1 check passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10949450375

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 81.829%

Totals Coverage Status
Change from base Build 10895584314: 0.005%
Covered Lines: 22342
Relevant Lines: 25861

💛 - Coveralls

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.

2 participants