You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We may need to use a different sourceMapRegEx for inline code from the code reading through file path.
In Istanbul, if we instrument a file with option "embed-source:true", it will wrap the code with an immediate function. Like:
"(function() {
//original JS code....
/#sourceMappingURL=data:application/json;base64........
}());"
In this situation, the sourceMapRegEx cannot match the code, because it doesn't expect the code ending with some special characters like ')', and it couldn't resolve the sourceMap for this file.
I have tried to remove the $ from the sourceMapRegEx in CoverageTransformer.js line 66 and it can work.
var sourceMapRegEx = /(?:\/{2}[#@]{1,2}|\/\*)\s+sourceMappingURL\s*=\s*(data:(?:[^;]+;)+base64,)?(\S+)(?:\n\s*)?$/; var sourceMapRegEx = /(?:\/{2}[#@]{1,2}|\/\*)\s+sourceMappingURL\s*=\s*(data:(?:[^;]+;)+base64,)?(\S+)(?:\n\s*)?/;
I'm not sure if we can simply use this change to fix, could you please help take a look?
The text was updated successfully, but these errors were encountered:
We may need to use a different sourceMapRegEx for inline code from the code reading through file path.
In Istanbul, if we instrument a file with option "embed-source:true", it will wrap the code with an immediate function. Like:
"(function() {
//original JS code....
/#sourceMappingURL=data:application/json;base64........
}());"
In this situation, the sourceMapRegEx cannot match the code, because it doesn't expect the code ending with some special characters like ')', and it couldn't resolve the sourceMap for this file.
I have tried to remove the $ from the sourceMapRegEx in CoverageTransformer.js line 66 and it can work.
var sourceMapRegEx = /(?:\/{2}[#@]{1,2}|\/\*)\s+sourceMappingURL\s*=\s*(data:(?:[^;]+;)+base64,)?(\S+)(?:\n\s*)?$/;
var sourceMapRegEx = /(?:\/{2}[#@]{1,2}|\/\*)\s+sourceMappingURL\s*=\s*(data:(?:[^;]+;)+base64,)?(\S+)(?:\n\s*)?/;
I'm not sure if we can simply use this change to fix, could you please help take a look?
The text was updated successfully, but these errors were encountered: