-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Did preserveCache
stop working and noPreserveCache
become the default?
#222
Comments
Hi there, there was definitely quite a bit of ambiguity/bugs around cache and some recent changes related to it. Might've been a regression or maybe we just need to update the docs. When it comes to preserving cache, the key ambiguity is whether proxyquire is asked to preserve:
I believe the first is working properly but the latter may be broken. It's not clear to me how people are using these features. I'd be interested in getting it right in a proxyquire@3 so if you can share your use case that'd be helpful! |
Hey, sorry for the delayed response and thanks for the speedy response. My use case isn't very unique. I was just proxyquiring modules and I did not want the stubbed modules to get cached, so I used the One day, I tried omitting the To be clear - I think this behavior is just fine, and it's what I originally expected the default to be when I first started using Proxyquire. I only used |
A coworker was asking me about
noPreserveCache
and when it is/isn't needed, and I was a bit surprised to find the example in the docs forpreserveCache
are no longer accurate. In short, it seems like the answer is now 'noPreserveCache' is never explicitly needed, because it's the default :)Based on https://github.com/thlorenz/proxyquire#forcing-proxyquire-to-reload-modules:
For testing, I created a simple
foo.js
with a single linemodule.exports = {};
The asserts fail with an error like:
Is this expected? I haven't found any recently issues/PRs (yet) that justify this change in behavior.
This was using proxyquire v2.1.0
The text was updated successfully, but these errors were encountered: