jhnns / rewire-webpack

Dependency injection for webpack bundles
The Unlicense
121 stars 20 forks source link

Upgrade webpack to 2.2 #24

Closed RSO closed 7 years ago

RSO commented 7 years ago

This PR is pretty much the result of me banging my head against the wall while trying to get the tests running. All tests are supposed to show up green now!

Seeing how this plugin seems to be pretty much set in terms of what it does, I figured a major release would be the way to go., unless someone can figure out a pretty way to support both versions of webpack next to each other.

Should fix #22

rtibbles commented 7 years ago

This saved my build - gets my vote!

RSO commented 7 years ago

NOTE: I just discovered a strange problem in our own testsuite on Webpack2.2. It seems that second/third runs don't properly rewire resources. I have no clue what is going on, and we decided to actually move away from rewire, so I won't be able to update this PR. I hope that somebody else will be able to figure out what's going on!

nadavsinai commented 7 years ago

@RSO thanks for your work, I'm curious what are you using instead of rewire?

RSO commented 7 years ago

Not using anything anymore, we've decided that unit-tests like this add less value to our codebase in comparison to the pain they add. In some cases we found other ways around rewire, for instance in cases where we had to mock window.location =, we decide to create a redirectHelper that actually returns a sinon.spy() when called in the test environment.

In other cases we decided that mocking was just simply not the way to go.