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

Prevent logs from being outputed in our unit tests #1612

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Dec 23, 2024

Our unit tests had become noisy with deprecation notices and RxPlayer log outputs.

That noise doesn't play well with how those unit tests report as we generally configure them to have a compact output in the terminal (with the idea that a passing test is not useful information but a breaking test is).
Those added logs break that compact output into a unreadable mess of uninteresting warnings, which I find especially problematic for tests.

So here, I remove the 2 culprits for those logs:

  • deprecation notices from vitest have been handled by updating the tests (though I'm not sure of why they print deprecation logs each time when the same deprecated logic is encountered multiple times, one signal would have been enough and preferable IMO)

  • All logger unit tests mock console functions now

Our unit tests had become noisy with deprecation notices and RxPlayer
log outputs.

That noise doesn't play well with how those unit tests report as we
generally configure them to have a compact output in the terminal (with
the idea that a passing test is not useful information but a breaking
test is).
Those added logs break that compact output into a unreadable mess of
uninteresting warnings, which I find especially problematic for tests.

So here, I remove the 2 culprits for those logs:

  - deprecation notices from vitest have been handled by updating the
    tests (though I'm not sure of why they print deprecation logs each
    time when the same deprecated logic is encountered multiple times,
    one signal would have been enough and preferable IMO)

  - logs tests all mock `console` functions now
@peaBerberian peaBerberian added this to the 4.3.0 milestone Dec 23, 2024
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.

1 participant