-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
v7 breaks sinon stubbing #410
Comments
x is now a getter, because the codebase uses typescript and native esm, and live bindings need to work (even when transpiled to commonjs). possible workarounds:
|
Thanks for the quick response. I did try changing my code to call tar.extract insted of tar.x but this cannot be stubbed by sinon, doing a |
Rather than requiring Do the same where you mock. That module directly exports the fn |
Thanks! The following does appear to at least pass unit tests again:
|
We use sinon in our (common JS) unit tests for code which uses the tar.x function. This work fine with v6.
When using v7 with no other changes to our code or tests, the tests which involve the x function fail with error
TAR_BAD_ARCHIVE: Unrecognized archive format
which indicates the stubbing is not effective, despite the sinon.stub and sinon.restore calls appearing to be successful.The text was updated successfully, but these errors were encountered: