identity-obj-proxy
identity-obj-proxy copied to clipboard
Webpack loader
Here goes a simple webpack loader: https://github.com/lucasconstantino/identity-object-proxy-loader
Hey, thanks for making this! Just curious, what are your use cases for this as a webpack loader?
When using Jest, you always have to fix a bunch of stuff Webpack takes care of; aliases, loaders, etc. It's very easy to use identity-obj-proxy directly as a mock for some kind of files such as .css, but you always get stuck with something else Webpack is doing which is hard to replicate on Jest. Therefore, sometimes it's easier to have a specific webpack file just for running tests, something that extends the default webpack configuration for you app. In this case, I'll use this loader to address .css files while testing.
Did it make sense?
Thanks. We just replaced Jest's scriptPreprocessor config with transform (facebook/jest#1917), which is a mapping from extensions to transformer scripts. There's an example usage at facebook/jest#2035. It might fit your needs better -- let me know what you think!
Hey, that's really cool! You guys are improving :) For sure this will fit most of my use cases. Anyway, I think there are still parts of Webpack that simply shouldn't be handled by Jest or any other tool. I mean, I can never really guarantee things will get done the same way by the both of them, Jest and Webpack.
Thanks for all the reply!
Thanks, let's keep this issue open for visibility.