-
Notifications
You must be signed in to change notification settings - Fork 233
test: add unit tests for EmailController and ReportController #1267
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
base: develop
Are you sure you want to change the base?
test: add unit tests for EmailController and ReportController #1267
Conversation
Please update the PR description to address these issues. |
|
@pranav718 everything seems okay just the SonarCloud is failing due to duplicated code. Can you make something to make the files more reusable? |
|
Thanks for the feedback @marcgc21! I'll refactor the test files to reduce duplication by:
The duplicated code % will reduce a lot with this. Will push the changes shortly! |
84eeda4 to
5e08cd1
Compare
|
Hi @pranav718, just one question, when you run the npm run test, it appears something like that?
|
|
Hi @marcgc21! Sorry about that! Yes, you're right, those console.error messages were appearing in the test output. I should have caught that earlier. Those were expected errors from the error handling test cases, but they were cluttering the output and making it look messy. My apologies for the oversight! I've fixed this by mocking console.error in both test files during beforeEach and restoring it in afterEach. The tests still verify the error handling behavior correctly, but now the output is clean: Thanks for pointing this out |
|





Summary
Continuation of #1089 - adding unit tests for the remaining untested controllers as suggested by @marcgc21.
This PR adds 12 new unit tests for:
Changes
Test Coverage
EmailController
ReportController
heuristicAnswersfieldtaskAnswersfieldTesting