community-platform
community-platform copied to clipboard
chore: deal with jest console warnings
PR Checklist
- [x] - Commit messages are descriptive, it will be used in our Release Notes
PR Type
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Developer experience (improves developer workflows for contributing to the project)
Description
I dealt with most of the Jest console warnings as well as the unnecessary logging appearing.
-
For
logger
itself, I expected the test log entries of debug, info, warn, fatal instead of displaying them. -
For
Message.store.tsx
I removed the logger.error calls because the test looks for Errors thrown so no need to cloud the logging, if the tests will fail in that regard. -
For files that called logger.info, I switched to logger.debug instead to hide the calls in the tests, but keep them around for debugging. Let me know if you think this what the right choice for those items.
-
There were a few tests like in
user.store.test.tsx
where it was testing for if two users were returned form the same id and it would return a warning, but if it wouldn't cause a failure of the test.
So for those type of scenarios, I decided to mock the warning to hide from the test suite, since its not failing on expect. Let me know if you want something different in that scenario.
Lastly, while trying to figure out the best approach, I noticed that in functions/src/test/firebase/logger.ts
there was at one point a top level mock that spied on all firebase logger methods
Git Issues
Closes #3303
1 failed test on run #5361 ↗︎
![]() |
![]() |
![]() |
![]() |
![]() |
Details:
chore: deal with jest console warnings | |||
Project: onearmy-community-platform | Commit: 7315692b72 |
||
Status: Failed | Duration: 04:36 💡 | ||
Started: Apr 2, 2024 8:23 PM | Ended: Apr 2, 2024 8:28 PM |
src/integration/settings.spec.ts • 1 failed test • ci-chrome
Test | Artifacts | |
---|---|---|
[Settings] > [All account types > [Can update username and password] |
Test Replay
Screenshots
Video
|
Review all test suite changes for PR #3410 ↗︎
Hey @Robert-LC hope you're well, will you have a chance to have a look at this again soon?