speedskater / babel-plugin-rewire

A babel plugin adding the ability to rewire module dependencies. This enables to mock modules for testing purposes.
843 stars 90 forks source link

Istanbul setup in README is out of date #157

Closed jseminck closed 7 years ago

jseminck commented 7 years ago

I was going through the README and saw there was a section covering setup with Istanbul. I think this section is now out of date since the release of babel-plugin-istanbul.

There was an issue where babel-plugin-istanbul and babel-plugin-rewire were not working together but this has been resolved (for me, at least) yesterday.

speedskater commented 7 years ago

@jseminck Thanks for the feedback. Same as on #155 I hope i will get to it on upcoming monday.

speedskater commented 7 years ago

@jseminck Thanks again, I will wait till this issue is resolved https://github.com/speedskater/babel-plugin-rewire/issues/148 and will then update the README section and link to your sample project. Is this okay for you?

jseminck commented 7 years ago

Hey, sure yes. My project should work as is now (as long as the version is fixed to rc4 at least). Did you have any problems?

I'm not entirely sure those last PRs to istanbul-lib-coverage etc... should make it work with rc5 and rc6, but we can see after they get merged. :)

speedskater commented 7 years ago

@jseminck You are right. I just tried your test project with istanbul-lib-coverage@1.0.0 and stanbul-lib-instrument@1.1.1 and the same problem occurred as before. Then I started over and switched the plugin order in babelrc to "plugins": [ "istanbul", "rewire" ] and npm test worked fine. I think this order makes more sense, as it adds the istanbul instrumentations before the rewiring and hence should result in more accurate coverage results. I just submitted a PR for your project to review.

Regarding the updated README I think this will take some more days, till I find time for it (sorry).

jseminck commented 7 years ago

Aha, good thinking. I'll try it out today and see how it affects things. That would be pretty good if that fixed the remaining issue! :)

speedskater commented 7 years ago

Istanbul workflow is up to date now.