Open krisread opened 7 years ago
I have made a helpful test case with a PR for you from my fork:
https://github.com/speedskater/babel-plugin-rewire/pull/175
Please take a look, this shows that using babel-plugin-rewire breaks Sinon stub
I'm having the same issue with sinon.stub()
having stopped working for named exports after installing babel-plugin-reqire. I was able to work around it by replacing stub()
with a combination of __Rewire__()
and sinon.spy()
for now, but it would be great if the issue could be fixed. Thanks!
@krisread, @apomortsev Thanks for reporting this issue and sorry for the late reply. The issue will be tackled, but this won't happen before mid of march, due to a very tight schedule. Sorry for the inconvenience.
@speedskater Just curious if there plans for this? Thanks!
@goodgec sorry for the delay on this issue, but I cannot predict when we will be able to fix this issue, I can only assure, that it won't be forgotten.
Any update on this?
This plugin looks very promising and we really want to use it. But we got the same issue. The workaround @apomortsev mentioned definitely works, but we have way too many tests to update all sinon.stub
usages.
you could look at overriding the stub with prototype that injected the workaround above.. just an idea
Hi!
We noticed that as soon as we installed babel-plugin-rewire our sinon methods like stub() / restore() in our mocha tests are no longer working. I would guess that this plugin is somehow clobbering the functions that handle stubbing and restoring.