-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add uvu/spy
module
#32
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 89.36% 90.47% +1.11%
==========================================
Files 3 4 +1
Lines 282 315 +33
==========================================
+ Hits 252 285 +33
Misses 30 30
Continue to review full report at Codecov.
|
Co-authored-by: Marcis Bergmanis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Just a side note: there is a similar lib, written in typescript, over here: https://github.com/tjoskar/simple-spy/blob/master/src/index.ts
Co-authored-by: Oskar Karlsson <[email protected]>
fwiw there's also: https://github.com/43081j/hanbi apologies for the self-promotion but it is rather tiny and more complete than what exists here, if you don't want to maintain your own. there's a few similar libraries around, too. i'd be happy to do some uvu integration for it if that'd help |
This PR adds a new
uvu/spy
package that exports a function to spy on function calls. This works with both sync and async functions. All function arguments, return values and the properthis
context is captured and can be asserted against.Example:
Fixes #10 .