Skip to content

fix: add an option to toggle logs when calling mocked instance #187

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

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

rchl
Copy link
Member

@rchl rchl commented Jun 3, 2020

Resolves #176

@rchl rchl requested a review from aldarund June 3, 2020 20:21
@rchl
Copy link
Member Author

rchl commented Jun 3, 2020

@simllll FYI

@simllll
Copy link
Contributor

simllll commented Jun 3, 2020

Thanks for tagging! To be honest: we liked this additional logging very much. It only outputs something if sentry is called - which is only in an error scenario in our case. It helps a lot to see what went wrong in dev, or if something is intended to fail if it is sent to sentry or not (which is sometimes the case and sometimes not).

I would vote for an additional option to let sentry be verbose when disabled. But as a trade off, it can be disabled by default?

@rchl
Copy link
Member Author

rchl commented Jun 3, 2020

I've added an option to log mock calls (enabled by default to not create a breaking change).

@codecov
Copy link

codecov bot commented Jun 3, 2020

Codecov Report

Merging #187 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #187   +/-   ##
=======================================
  Coverage   45.61%   45.61%           
=======================================
  Files           1        1           
  Lines          57       57           
  Branches       17       17           
=======================================
  Hits           26       26           
  Misses         22       22           
  Partials        9        9           
Impacted Files Coverage Δ
lib/module.js 45.61% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7eec715...3500d82. Read the comment docs.

Copy link
Contributor

@simllll simllll left a comment

Choose a reason for hiding this comment

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

LGTM!

@rchl rchl changed the title fix: don't log anything when calling methods on mocked instance fix: add an option to toggle logs when calling mocked instance Jun 3, 2020
@rchl rchl merged commit 6a1692e into master Jun 3, 2020
@rchl rchl deleted the fix/remove-mock-logs branch June 3, 2020 20:54
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.

How to programatically check if Sentry is disabled?
2 participants