-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
fix: Purge source-map cache before reporting if cache is disabled. #1080
Conversation
@istanbuljs/core awesome work 👍 weirdly, |
lib/source-maps.js
Outdated
function SourceMaps (opts) { | ||
this.cache = opts.cache | ||
this.cacheDirectory = opts.cacheDirectory | ||
this.loadedMaps = {} | ||
this._sourceMapCache = sourceMapCache | ||
} | ||
|
||
SourceMaps.prototype.purgeCache = function () { | ||
sourceMapCache = libSourceMaps.createSourceMapStore() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we'd need to throw out source maps like this, might be worth digging into things a bit more, and figuring out how we end up with incompatible source-maps in the first place.
I'm not opposed to landing this as a patch as a temporary measure, but it feels like we're continuing to complicate our source-map and caching logic, which is already a mess. I think you're right that we just need to get way more test cases in the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same reason we need to throw out transform results (they set cache: false
).
This is unneeded since we always limit ourselves to a single NYC instance.
For istanbul-lib-source-maps I think definitely. Once we do that I think we should ping Simen from jest to ensure it doesn't cause regressions for them. |
@bcoe this (combined with istanbuljs/istanbuljs#375) seems to fix #1049 (and likely others like it).