-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feat Request: add option to change getter to value #15
Comments
I have the same problem with stubbing dynamic imports with sinon. |
It is true that Sinon by itself cannot modify exports that immutable. Since SWC is often setup to use CommonJS as the module system (which is the case here) for the transpiled code, you can easily achieve stubbing modules using Quibble or any other module loader hooks for CJS, and do stubbing in combination with Sinon, as described on the Sinon homepage. I even have an example for SWC using Quibble. If you choose not to use a module loader, there are manual workarounds such as described here: sinonjs/sinon#2403 |
Thanks all of you. |
@zyf0330 You did not have to close it, it still makes sense IMHO. The current way it works makes SWC work differently from how |
To be compatible with
sinon.stub(obj, "method")
, else this code must be changed tosinon.stub(obj, "method").get(sinon.stub())
The text was updated successfully, but these errors were encountered: